Skip to content

Commit f3bbd4a

Browse files
committed
Avoid resilvering ChannelMonitors on startup
LDK 0.2 added a method to load `ChannelMonitor`s on startup without resilvering them, avoiding the startup latency of persistence for each `ChannelMonitor`. Here we start using it.
1 parent dd55d47 commit f3bbd4a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,8 +1438,8 @@ fn build_with_store_internal(
14381438
// Give ChannelMonitors to ChainMonitor
14391439
for (_blockhash, channel_monitor) in channel_monitors.into_iter() {
14401440
let channel_id = channel_monitor.channel_id();
1441-
chain_monitor.watch_channel(channel_id, channel_monitor).map_err(|e| {
1442-
log_error!(logger, "Failed to watch channel monitor: {:?}", e);
1441+
chain_monitor.load_existing_monitor(channel_id, channel_monitor).map_err(|e| {
1442+
log_error!(logger, "Failed to load channel monitor: {:?}", e);
14431443
BuildError::InvalidChannelMonitor
14441444
})?;
14451445
}

0 commit comments

Comments
 (0)