From: Elias Rohrer Date: Tue, 31 Jan 2023 23:07:31 +0000 (-0600) Subject: Return only `Some(block_hash)` in CM rel. txids X-Git-Tag: v0.0.114-beta~34^2~1 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=041c3e615fb2d4db8fcff7a9e5c864bbb3656502;p=rust-lightning Return only `Some(block_hash)` in CM rel. txids As of now the `Confirm::get_relevant_txids()` docs state that it won't return any transactions for which we hadn't previously seen a confirmation. To align its functionality a bit more with the docs, at least for `ChannelManager`, we only return values for which we had registered a confirmation block hash before. --- diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index b2a23c7c1..d6068c105 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -5786,8 +5786,8 @@ where let mut peer_state_lock = peer_state_mutex.lock().unwrap(); let peer_state = &mut *peer_state_lock; for chan in peer_state.channel_by_id.values() { - if let (Some(funding_txo), block_hash) = (chan.get_funding_txo(), chan.get_funding_tx_confirmed_in()) { - res.push((funding_txo.txid, block_hash)); + if let (Some(funding_txo), Some(block_hash)) = (chan.get_funding_txo(), chan.get_funding_tx_confirmed_in()) { + res.push((funding_txo.txid, Some(block_hash))); } } }