Merge pull request #3051 from TheBlueMatt/2024-04-2982-123-fix
[rust-lightning] / lightning / src / ln / channel.rs
index 5fbdb595b77101f8bf455e0761adc9de08437647..793d9af80b2b0e9f4d9574a4af202b1efe734e03 100644 (file)
@@ -7520,6 +7520,12 @@ impl<SP: Deref> OutboundV1Channel<SP> where SP::Target: SignerProvider {
                Ok(self.get_open_channel(chain_hash))
        }
 
+       /// Returns true if we can resume the channel by sending the [`msgs::OpenChannel`] again.
+       pub fn is_resumable(&self) -> bool {
+               !self.context.have_received_message() &&
+                       self.context.cur_holder_commitment_transaction_number == INITIAL_COMMITMENT_NUMBER
+       }
+
        pub fn get_open_channel(&self, chain_hash: ChainHash) -> msgs::OpenChannel {
                if !self.context.is_outbound() {
                        panic!("Tried to open a channel for an inbound channel?");