Simplify channelmonitor tests which use chain::Watch and Persister
[rust-lightning] / lightning / src / ln / channel.rs
index 4a6e4eb656b6f6fa2f9a5076814853d8ac77f9ea..7883d7b29e4806643c16513fcfc3aa751fffd709 100644 (file)
@@ -1903,6 +1903,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 {