You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Persist full monitor if there is an error while applying monitor_update
Motivation: When there is an error while applying monitor_update to a
channel_monitor, we don't want to persist a 'monitor_update' which
results in a failure to apply later while reading 'channel_monitor' with
updates from storage. Instead, we should persist the entire 'channel_monitor'
here.
let persist_res = self.persister.update_persisted_channel(funding_txo,Some(update), monitor, update_id);
770
+
let persist_res = if update_res.is_err(){
771
+
// Even if updating the monitor returns an error, the monitor's state will
772
+
// still be changed. Therefore, we should persist the updated monitor despite the error.
773
+
// We don't want to persist a `monitor_update` which results in a failure to apply later
774
+
// while reading `channel_monitor` with updates from storage. Instead, we should persist
775
+
// the entire `channel_monitor` here.
776
+
log_warn!(self.logger,"Failed to update ChannelMonitor for channel {}. Going ahead and persisting the entire ChannelMonitor", log_funding_info!(monitor));
0 commit comments