From f9c9acf8aa09e5e9f62dba575a87eb04d05919fe Mon Sep 17 00:00:00 2001 From: Gursharan Singh <3442979+G8XSU@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:14:55 -0800 Subject: [PATCH] Add comment for skipping cleanup due to read error --- lightning/src/util/persist.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs index fda08376f40..e6329062051 100644 --- a/lightning/src/util/persist.rs +++ b/lightning/src/util/persist.rs @@ -694,6 +694,7 @@ where if let chain::ChannelMonitorUpdateStatus::Completed = monitor_update_status { let cleanup_range = if monitor.get_latest_update_id() == CLOSED_CHANNEL_UPDATE_ID { + // If there is an error while reading old monitor, we skip clean up. maybe_old_monitor.map(|(_, ref old_monitor)| { let start = old_monitor.get_latest_update_id(); // We never persist an update with update_id = CLOSED_CHANNEL_UPDATE_ID