@@ -507,19 +507,19 @@ struct ClaimablePayments {
507
507
/// running normally, and specifically must be processed before any other non-background
508
508
/// [`ChannelMonitorUpdate`]s are applied.
509
509
enum BackgroundEvent {
510
- /// Handle a ChannelMonitorUpdate which closes the channel. This is only separated from
511
- /// [`Self::MonitorUpdateRegeneratedOnStartup`] as the maybe-non-closing variant needs a public
512
- /// key to handle channel resumption, whereas if the channel has been force-closed we do not
513
- /// need the counterparty node_id.
510
+ /// Handle a ChannelMonitorUpdate which closes the channel or for an already-closed channel.
511
+ /// This is only separated from [`Self::MonitorUpdateRegeneratedOnStartup`] as the
512
+ /// maybe-non-closing variant needs a public key to handle channel resumption, whereas if the
513
+ /// channel has been force-closed we do not need the counterparty node_id.
514
514
///
515
515
/// Note that any such events are lost on shutdown, so in general they must be updates which
516
516
/// are regenerated on startup.
517
- ClosingMonitorUpdateRegeneratedOnStartup ( ( OutPoint , ChannelMonitorUpdate ) ) ,
517
+ ClosedMonitorUpdateRegeneratedOnStartup ( ( OutPoint , ChannelMonitorUpdate ) ) ,
518
518
/// Handle a ChannelMonitorUpdate which may or may not close the channel and may unblock the
519
519
/// channel to continue normal operation.
520
520
///
521
521
/// In general this should be used rather than
522
- /// [`Self::ClosingMonitorUpdateRegeneratedOnStartup `], however in cases where the
522
+ /// [`Self::ClosedMonitorUpdateRegeneratedOnStartup `], however in cases where the
523
523
/// `counterparty_node_id` is not available as the channel has closed from a [`ChannelMonitor`]
524
524
/// error the other variant is acceptable.
525
525
///
@@ -4103,7 +4103,7 @@ where
4103
4103
4104
4104
for event in background_events. drain ( ..) {
4105
4105
match event {
4106
- BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( ( funding_txo, update) ) => {
4106
+ BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( ( funding_txo, update) ) => {
4107
4107
// The channel has already been closed, so no use bothering to care about the
4108
4108
// monitor updating completing.
4109
4109
let _ = self . chain_monitor . update_channel ( funding_txo, & update) ;
@@ -4763,15 +4763,15 @@ where
4763
4763
// If we're running during init we cannot update a monitor directly - they probably
4764
4764
// haven't actually been loaded yet. Instead, push the monitor update as a background
4765
4765
// event.
4766
- // Note that while its safe to use `ClosingMonitorUpdateRegeneratedOnStartup ` here (the
4766
+ // Note that while it's safe to use `ClosedMonitorUpdateRegeneratedOnStartup ` here (the
4767
4767
// channel is already closed) we need to ultimately handle the monitor update
4768
4768
// completion action only after we've completed the monitor update. This is the only
4769
4769
// way to guarantee this update *will* be regenerated on startup (otherwise if this was
4770
4770
// from a forwarded HTLC the downstream preimage may be deleted before we claim
4771
4771
// upstream). Thus, we need to transition to some new `BackgroundEvent` type which will
4772
4772
// complete the monitor update completion action from `completion_action`.
4773
4773
self . pending_background_events . lock ( ) . unwrap ( ) . push (
4774
- BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( (
4774
+ BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( (
4775
4775
prev_hop. outpoint , preimage_update,
4776
4776
) ) ) ;
4777
4777
}
@@ -8262,7 +8262,7 @@ where
8262
8262
update_id : CLOSED_CHANNEL_UPDATE_ID ,
8263
8263
updates : vec ! [ ChannelMonitorUpdateStep :: ChannelForceClosed { should_broadcast: true } ] ,
8264
8264
} ;
8265
- close_background_events. push ( BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( ( * funding_txo, monitor_update) ) ) ;
8265
+ close_background_events. push ( BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( ( * funding_txo, monitor_update) ) ) ;
8266
8266
}
8267
8267
}
8268
8268
0 commit comments