Skip to content

Commit 1d76c69

Browse files
committed
f Account for ChannelMonitors being tracked by ChannelId
1 parent 705beea commit 1d76c69

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1275,8 +1275,8 @@ fn build_with_store_internal(
12751275

12761276
// Give ChannelMonitors to ChainMonitor
12771277
for (_blockhash, channel_monitor) in channel_monitors.into_iter() {
1278-
let funding_outpoint = channel_monitor.get_funding_txo().0;
1279-
chain_monitor.watch_channel(funding_outpoint, channel_monitor).map_err(|e| {
1278+
let channel_id = channel_monitor.channel_id();
1279+
chain_monitor.watch_channel(channel_id, channel_monitor).map_err(|e| {
12801280
log_error!(logger, "Failed to watch channel monitor: {:?}", e);
12811281
BuildError::InvalidChannelMonitor
12821282
})?;

src/chain/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ impl ChainSource {
445445
if let Some(worst_channel_monitor_block_hash) = chain_monitor
446446
.list_monitors()
447447
.iter()
448-
.flat_map(|(txo, _)| chain_monitor.get_monitor(*txo))
448+
.flat_map(|channel_id| chain_monitor.get_monitor(*channel_id))
449449
.map(|m| m.current_best_block())
450450
.min_by_key(|b| b.height)
451451
.map(|b| b.block_hash)

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,8 +1426,8 @@ impl Node {
14261426

14271427
let mut total_lightning_balance_sats = 0;
14281428
let mut lightning_balances = Vec::new();
1429-
for (funding_txo, channel_id) in self.chain_monitor.list_monitors() {
1430-
match self.chain_monitor.get_monitor(funding_txo) {
1429+
for channel_id in self.chain_monitor.list_monitors() {
1430+
match self.chain_monitor.get_monitor(channel_id) {
14311431
Ok(monitor) => {
14321432
// unwrap safety: `get_counterparty_node_id` will always be `Some` after 0.0.110 and
14331433
// LDK Node 0.1 depended on 0.0.115 already.

0 commit comments

Comments
 (0)