Skip to content

Commit 3a15c2f

Browse files
committed
f Account for ChannelMonitors being tracked by ChannelId
1 parent 8267b83 commit 3a15c2f

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
@@ -1413,8 +1413,8 @@ fn build_with_store_internal(
14131413

14141414
// Give ChannelMonitors to ChainMonitor
14151415
for (_blockhash, channel_monitor) in channel_monitors.into_iter() {
1416-
let funding_outpoint = channel_monitor.get_funding_txo().0;
1417-
chain_monitor.watch_channel(funding_outpoint, channel_monitor).map_err(|e| {
1416+
let channel_id = channel_monitor.channel_id();
1417+
chain_monitor.watch_channel(channel_id, channel_monitor).map_err(|e| {
14181418
log_error!(logger, "Failed to watch channel monitor: {:?}", e);
14191419
BuildError::InvalidChannelMonitor
14201420
})?;

src/chain/bitcoind.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl BitcoindChainSource {
177177
if let Some(worst_channel_monitor_block_hash) = chain_monitor
178178
.list_monitors()
179179
.iter()
180-
.flat_map(|(txo, _)| chain_monitor.get_monitor(*txo))
180+
.flat_map(|channel_id| chain_monitor.get_monitor(*channel_id))
181181
.map(|m| m.current_best_block())
182182
.min_by_key(|b| b.height)
183183
.map(|b| b.block_hash)

src/lib.rs

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

14051405
let mut total_lightning_balance_sats = 0;
14061406
let mut lightning_balances = Vec::new();
1407-
for (funding_txo, channel_id) in self.chain_monitor.list_monitors() {
1408-
match self.chain_monitor.get_monitor(funding_txo) {
1407+
for channel_id in self.chain_monitor.list_monitors() {
1408+
match self.chain_monitor.get_monitor(channel_id) {
14091409
Ok(monitor) => {
14101410
// unwrap safety: `get_counterparty_node_id` will always be `Some` after 0.0.110 and
14111411
// LDK Node 0.1 depended on 0.0.115 already.

0 commit comments

Comments
 (0)