From a4f46639f6e4f14ecb25e1b4a48b89eed03125e1 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Thu, 30 Oct 2025 16:47:26 +0000 Subject: [PATCH] Include monitor name in error when failing to load a monitor If we fail to load a `ChannelMonitor` due to the new limits in LDK 0.2, its useful to communicate which monitor failed, which we do here. Requested at https://github.com/lightningdevkit/rust-lightning/pull/4146#discussion_r2418136988 --- lightning/src/util/persist.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lightning/src/util/persist.rs b/lightning/src/util/persist.rs index 5d34603c96b..e75f35e65cd 100644 --- a/lightning/src/util/persist.rs +++ b/lightning/src/util/persist.rs @@ -955,9 +955,12 @@ where Some(res) => Ok(res), None => Err(io::Error::new( io::ErrorKind::InvalidData, - "ChannelMonitor was stale, with no updates since LDK 0.0.118. \ + format!( + "ChannelMonitor {} was stale, with no updates since LDK 0.0.118. \ It cannot be read by modern versions of LDK, though also does not contain any funds left to sweep. \ You should manually delete it instead", + monitor_key, + ), )), } }