]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Merge pull request #1796 from tnull/2022-10-track-confirmation-block-hash
authorMatt Corallo <649246+TheBlueMatt@users.noreply.github.com>
Wed, 9 Nov 2022 20:24:10 +0000 (20:24 +0000)
committerGitHub <noreply@github.com>
Wed, 9 Nov 2022 20:24:10 +0000 (20:24 +0000)
Track confirmation block hash and return via `Confirm::get_relevant_txids`

1  2 
lightning/src/chain/chainmonitor.rs
lightning/src/chain/channelmonitor.rs
lightning/src/ln/channelmanager.rs
lightning/src/ln/reorg_tests.rs

Simple merge
Simple merge
index 7f9531331b448239bb89db06d68ed397d6092afb,a24e623e3c47c4d206fa73b8d45adaa928b41531..91a853132064049abca699a211de956e6e5cdc22
@@@ -5906,12 -5853,12 +5906,12 @@@ wher
                });
        }
  
-       fn get_relevant_txids(&self) -> Vec<Txid> {
+       fn get_relevant_txids(&self) -> Vec<(Txid, Option<BlockHash>)> {
                let channel_state = self.channel_state.lock().unwrap();
 -              let mut res = Vec::with_capacity(channel_state.short_to_chan_info.len());
 +              let mut res = Vec::with_capacity(channel_state.by_id.len());
                for chan in channel_state.by_id.values() {
-                       if let Some(funding_txo) = chan.get_funding_txo() {
-                               res.push(funding_txo.txid);
+                       if let (Some(funding_txo), block_hash) = (chan.get_funding_txo(), chan.get_funding_tx_confirmed_in()) {
+                               res.push((funding_txo.txid, block_hash));
                        }
                }
                res
Simple merge