Merge pull request #2622 from wpaulino/funding-and-commitment-tx-confirm-same-block
[rust-lightning] / lightning / src / ln / channel.rs
index 77a04e872d768a298db50418b09b65d98e34b0c2..a61a8de82debecd5906c0ee95bdcdb420aae48f4 100644 (file)
@@ -4819,6 +4819,7 @@ impl<SP: Deref> Channel<SP> where
                NS::Target: NodeSigner,
                L::Target: Logger
        {
+               let mut msgs = (None, None);
                if let Some(funding_txo) = self.context.get_funding_txo() {
                        for &(index_in_block, tx) in txdata.iter() {
                                // Check if the transaction is the expected funding transaction, and if it is,
@@ -4874,7 +4875,7 @@ impl<SP: Deref> Channel<SP> where
                                        if let Some(channel_ready) = self.check_get_channel_ready(height) {
                                                log_info!(logger, "Sending a channel_ready to our peer for channel {}", &self.context.channel_id);
                                                let announcement_sigs = self.get_announcement_sigs(node_signer, genesis_block_hash, user_config, height, logger);
-                                               return Ok((Some(channel_ready), announcement_sigs));
+                                               msgs = (Some(channel_ready), announcement_sigs);
                                        }
                                }
                                for inp in tx.input.iter() {
@@ -4885,7 +4886,7 @@ impl<SP: Deref> Channel<SP> where
                                }
                        }
                }
-               Ok((None, None))
+               Ok(msgs)
        }
 
        /// When a new block is connected, we check the height of the block against outbound holding