Skip to content

Commit 9e14256

Browse files
committed
Include funding TXO in outputs to watch
The funding TXO was never added to ChannelMonitor's outputs_to_watch in 73dce20. Include it when constructing a ChannelMonitor.
1 parent 95b7eee commit 9e14256

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lightning/src/chain/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ pub trait Watch: Send + Sync {
7272
/// Watches a channel identified by `funding_txo` using `monitor`.
7373
///
7474
/// Implementations are responsible for watching the chain for the funding transaction along
75-
/// with spends of its output and any outputs returned by [`get_outputs_to_watch`]. In practice,
76-
/// this means calling [`block_connected`] and [`block_disconnected`] on the monitor and
77-
/// including all such transactions that meet this criteria.
75+
/// with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
76+
/// calling [`block_connected`] and [`block_disconnected`] on the monitor and including all such
77+
/// transactions that meet this criteria.
7878
///
7979
/// [`get_outputs_to_watch`]: ../ln/channelmonitor/struct.ChannelMonitor.html#method.get_outputs_to_watch
8080
/// [`block_connected`]: ../ln/channelmonitor/struct.ChannelMonitor.html#method.block_connected

lightning/src/ln/channelmonitor.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,6 +1252,9 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
12521252
};
12531253
onchain_tx_handler.provide_latest_holder_tx(initial_holder_commitment_tx);
12541254

1255+
let mut outputs_to_watch = HashMap::new();
1256+
outputs_to_watch.insert(funding_info.0.txid, vec![funding_info.1.clone()]);
1257+
12551258
ChannelMonitor {
12561259
latest_update_id: 0,
12571260
commitment_transaction_number_obscure_factor,
@@ -1288,7 +1291,7 @@ impl<ChanSigner: ChannelKeys> ChannelMonitor<ChanSigner> {
12881291
pending_events: Vec::new(),
12891292

12901293
onchain_events_waiting_threshold_conf: HashMap::new(),
1291-
outputs_to_watch: HashMap::new(),
1294+
outputs_to_watch,
12921295

12931296
onchain_tx_handler,
12941297

0 commit comments

Comments
 (0)