]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Rename `Channel::monitor_update_failed` to `monitor_updating_paused`
authorMatt Corallo <git@bluematt.me>
Tue, 16 Aug 2022 22:15:32 +0000 (22:15 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 29 Sep 2022 20:27:53 +0000 (20:27 +0000)
lightning/src/ln/channel.rs
lightning/src/ln/channelmanager.rs

index 55568f3d6c57cdeb4121cf58b2947a57405bef92..48a701e3b04fb712772a3a9a293536e839ee6de4 100644 (file)
@@ -3657,13 +3657,16 @@ impl<Signer: Sign> Channel<Signer> {
                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<HTLCSource>
index bbecc4b339fa09f5c336bfb45f3053402b3a7ba8..581c66fd4bb61c422ecbc665e90c4bf72f900390 100644 (file)
@@ -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<Signer: Sign, M: Deref, T: Deref, K: Deref, F: Deref, L: Deref> 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
                        },
                }