From f3bbd4a4882d4ecd370bf94ae0d0ff3de245b049 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 8 Jan 2026 12:51:28 +0000 Subject: [PATCH] Avoid resilvering `ChannelMonitor`s 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. --- src/builder.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/builder.rs b/src/builder.rs index e7e2de286..187f780d2 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -1438,8 +1438,8 @@ fn build_with_store_internal( // Give ChannelMonitors to ChainMonitor for (_blockhash, channel_monitor) in channel_monitors.into_iter() { let channel_id = channel_monitor.channel_id(); - chain_monitor.watch_channel(channel_id, channel_monitor).map_err(|e| { - log_error!(logger, "Failed to watch channel monitor: {:?}", e); + chain_monitor.load_existing_monitor(channel_id, channel_monitor).map_err(|e| { + log_error!(logger, "Failed to load channel monitor: {:?}", e); BuildError::InvalidChannelMonitor })?; }