@@ -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
///
@@ -4108,7 +4108,7 @@ where
4108
4108
4109
4109
for event in background_events. drain ( ..) {
4110
4110
match event {
4111
- BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( ( funding_txo, update) ) => {
4111
+ BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( ( funding_txo, update) ) => {
4112
4112
// The channel has already been closed, so no use bothering to care about the
4113
4113
// monitor updating completing.
4114
4114
let _ = self . chain_monitor . update_channel ( funding_txo, & update) ;
@@ -4768,15 +4768,15 @@ where
4768
4768
// If we're running during init we cannot update a monitor directly - they probably
4769
4769
// haven't actually been loaded yet. Instead, push the monitor update as a background
4770
4770
// event.
4771
- // Note that while its safe to use `ClosingMonitorUpdateRegeneratedOnStartup ` here (the
4771
+ // Note that while its safe to use `ClosedMonitorUpdateRegeneratedOnStartup ` here (the
4772
4772
// channel is already closed) we need to ultimately handle the monitor update
4773
4773
// completion action only after we've completed the monitor update. This is the only
4774
4774
// way to guarantee this update *will* be regenerated on startup (otherwise if this was
4775
4775
// from a forwarded HTLC the downstream preimage may be deleted before we claim
4776
4776
// upstream). Thus, we need to transition to some new `BackgroundEvent` type which will
4777
4777
// complete the monitor update completion action from `completion_action`.
4778
4778
self . pending_background_events . lock ( ) . unwrap ( ) . push (
4779
- BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( (
4779
+ BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( (
4780
4780
prev_hop. outpoint , preimage_update,
4781
4781
) ) ) ;
4782
4782
}
@@ -8267,7 +8267,7 @@ where
8267
8267
update_id : CLOSED_CHANNEL_UPDATE_ID ,
8268
8268
updates : vec ! [ ChannelMonitorUpdateStep :: ChannelForceClosed { should_broadcast: true } ] ,
8269
8269
} ;
8270
- close_background_events. push ( BackgroundEvent :: ClosingMonitorUpdateRegeneratedOnStartup ( ( * funding_txo, monitor_update) ) ) ;
8270
+ close_background_events. push ( BackgroundEvent :: ClosedMonitorUpdateRegeneratedOnStartup ( ( * funding_txo, monitor_update) ) ) ;
8271
8271
}
8272
8272
}
8273
8273
0 commit comments