Adds DiscardFunding event
[rust-lightning] / lightning / src / ln / channel.rs
index 858e307b77e429a6c992c0759bcdf751148ac251..936bbab7cc5912841de3c99a3bbdf68e8689fa0c 100644 (file)
@@ -1901,6 +1901,15 @@ impl<Signer: Sign> Channel<Signer> {
                Ok(())
        }
 
+       /// Returns transaction if there is pending funding transaction that is yet to broadcast
+       pub fn unbroadcasted_funding(&self) -> Option<Transaction> {
+                if self.channel_state & (ChannelState::FundingCreated as u32) != 0 {
+                        self.funding_transaction.clone()
+                } else {
+                        None
+                }
+       }
+
        /// Returns a HTLCStats about inbound pending htlcs
        fn get_inbound_pending_htlc_stats(&self) -> HTLCStats {
                let mut stats = HTLCStats {