From 721a85853374f37c23e69fe631842d3b4477f446 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 16 Aug 2022 22:15:32 +0000 Subject: [PATCH] Rename `Channel::monitor_update_failed` to `monitor_updating_paused` --- lightning/src/ln/channel.rs | 17 ++++++++++------- lightning/src/ln/channelmanager.rs | 4 ++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/lightning/src/ln/channel.rs b/lightning/src/ln/channel.rs index 55568f3d..48a701e3 100644 --- a/lightning/src/ln/channel.rs +++ b/lightning/src/ln/channel.rs @@ -3657,13 +3657,16 @@ impl Channel { log_trace!(logger, "Peer disconnection resulted in {} remote-announced HTLC drops on channel {}", inbound_drop_count, log_bytes!(self.channel_id())); } - /// Indicates that a ChannelMonitor update failed to be stored by the client and further - /// updates are partially paused. - /// This must be called immediately after the call which generated the ChannelMonitor update - /// which failed. The messages which were generated from that call which generated the - /// monitor update failure must *not* have been sent to the remote end, and must instead - /// have been dropped. They will be regenerated when monitor_updating_restored is called. - pub fn monitor_update_failed(&mut self, resend_raa: bool, resend_commitment: bool, + /// Indicates that a ChannelMonitor update is in progress and has not yet been fully persisted. + /// This must be called immediately after the [`chain::Watch`] call which returned + /// [`ChannelMonitorUpdateStatus::InProgress`]. + /// The messages which were generated with the monitor update must *not* have been sent to the + /// remote end, and must instead have been dropped. They will be regenerated when + /// [`Self::monitor_updating_restored`] is called. + /// + /// [`chain::Watch`]: crate::chain::Watch + /// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress + pub fn monitor_updating_paused(&mut self, resend_raa: bool, resend_commitment: bool, resend_channel_ready: bool, mut pending_forwards: Vec<(PendingHTLCInfo, u64)>, mut pending_fails: Vec<(HTLCSource, PaymentHash, HTLCFailReason)>, mut pending_finalized_claimed_htlcs: Vec diff --git a/lightning/src/ln/channelmanager.rs b/lightning/src/ln/channelmanager.rs index bbecc4b3..581c66fd 100644 --- a/lightning/src/ln/channelmanager.rs +++ b/lightning/src/ln/channelmanager.rs @@ -1368,7 +1368,7 @@ macro_rules! handle_monitor_err { if !$resend_raa { debug_assert!($action_type == RAACommitmentOrder::CommitmentFirst || !$resend_commitment); } - $chan.monitor_update_failed($resend_raa, $resend_commitment, $resend_channel_ready, $failed_forwards, $failed_fails, $failed_finalized_fulfills); + $chan.monitor_updating_paused($resend_raa, $resend_commitment, $resend_channel_ready, $failed_forwards, $failed_fails, $failed_finalized_fulfills); (Err(MsgHandleErrInternal::from_chan_no_close(ChannelError::Ignore("Failed to update ChannelMonitor".to_owned()), *$chan_id)), false) }, ChannelMonitorUpdateStatus::Completed => { @@ -4512,7 +4512,7 @@ impl ChannelMana // hasn't persisted to disk yet - we can't lose money on a transaction that we haven't // accepted payment from yet. We do, however, need to wait to send our channel_ready // until we have persisted our monitor. - chan.monitor_update_failed(false, false, channel_ready.is_some(), Vec::new(), Vec::new(), Vec::new()); + chan.monitor_updating_paused(false, false, channel_ready.is_some(), Vec::new(), Vec::new(), Vec::new()); channel_ready = None; // Don't send the channel_ready now }, } -- 2.30.2