Skip to content

Commit bc90d00

Browse files
authored
Merge pull request #1998 from tnull/2023-01-no-none-in-channel-relevant-txids
Only return previously confirmed Txids from CM's `get_relevant_txids()`
2 parents c59150a + 909bae5 commit bc90d00

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

lightning/src/chain/mod.rs

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ pub trait Confirm {
176176
/// Returns transactions that must be monitored for reorganization out of the chain along
177177
/// with the hash of the block as part of which it had been previously confirmed.
178178
///
179+
/// Note that the returned `Option<BlockHash>` might be `None` for channels created with LDK
180+
/// 0.0.112 and prior, in which case you need to manually track previous confirmations.
181+
///
179182
/// Will include any transactions passed to [`transactions_confirmed`] that have insufficient
180183
/// confirmations to be safe from a chain reorganization. Will not include any transactions
181184
/// passed to [`transaction_unconfirmed`], unless later reconfirmed.

lightning/src/ln/channelmanager.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5786,8 +5786,8 @@ where
57865786
let mut peer_state_lock = peer_state_mutex.lock().unwrap();
57875787
let peer_state = &mut *peer_state_lock;
57885788
for chan in peer_state.channel_by_id.values() {
5789-
if let (Some(funding_txo), block_hash) = (chan.get_funding_txo(), chan.get_funding_tx_confirmed_in()) {
5790-
res.push((funding_txo.txid, block_hash));
5789+
if let (Some(funding_txo), Some(block_hash)) = (chan.get_funding_txo(), chan.get_funding_tx_confirmed_in()) {
5790+
res.push((funding_txo.txid, Some(block_hash)));
57915791
}
57925792
}
57935793
}

0 commit comments

Comments
 (0)