Skip to content

Commit 01ed598

Browse files
committed
f struct variant enum cause no doc comments
1 parent be082aa commit 01ed598

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

lightning/src/ln/channelmanager.rs

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,18 @@ enum BackgroundEvent {
509509
/// Note that any such events are lost on shutdown, so in general they must be updates which
510510
/// are regenerated on startup.
511511
ClosingMonitorUpdateRegeneratedOnStartup((OutPoint, ChannelMonitorUpdate)),
512-
/// Handle a ChannelMonitorUpdate.
512+
/// Handle a ChannelMonitorUpdate which may or may not close the channel. In general this
513+
/// should be used rather than [`Self::ClosingMonitorUpdateRegeneratedOnStartup`], however in
514+
/// cases where the `counterparty_node_id` is not available as the channel has closed from a
515+
/// [`ChannelMonitor`] error the other variant is acceptable.
513516
///
514517
/// Note that any such events are lost on shutdown, so in general they must be updates which
515518
/// are regenerated on startup.
516-
MonitorUpdateRegeneratedOnStartup((
517-
/// The counterparty node_id for the channel being updated.
518-
PublicKey,
519-
OutPoint, ChannelMonitorUpdate)),
519+
MonitorUpdateRegeneratedOnStartup {
520+
counterparty_node_id: PublicKey,
521+
funding_txo: OutPoint,
522+
update: ChannelMonitorUpdate
523+
},
520524
}
521525

522526
#[derive(Debug)]
@@ -3792,7 +3796,7 @@ where
37923796
// monitor updating completing.
37933797
let _ = self.chain_monitor.update_channel(funding_txo, &update);
37943798
},
3795-
BackgroundEvent::MonitorUpdateRegeneratedOnStartup((_, funding_txo, update)) => {
3799+
BackgroundEvent::MonitorUpdateRegeneratedOnStartup { funding_txo, update, .. } => {
37963800
// The channel has already been closed, so no use bothering to care about the
37973801
// monitor updating completing.
37983802
let _ = self.chain_monitor.update_channel(funding_txo, &update);
@@ -5713,8 +5717,9 @@ where
57135717
assert!(should_broadcast);
57145718
} else { unreachable!(); }
57155719
self.pending_background_events.lock().unwrap().push(
5716-
BackgroundEvent::MonitorUpdateRegeneratedOnStartup(
5717-
(counterparty_node_id, funding_txo, update)));
5720+
BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
5721+
counterparty_node_id, funding_txo, update
5722+
});
57185723
}
57195724
self.finish_force_close_channel(failure);
57205725
}
@@ -7787,8 +7792,10 @@ where
77877792
log_error!(args.logger, " The ChannelMonitor for channel {} is at update_id {} but the ChannelManager is at update_id {}.",
77887793
log_bytes!(channel.channel_id()), monitor.get_latest_update_id(), channel.get_latest_monitor_update_id());
77897794
let (monitor_update, mut new_failed_htlcs) = channel.force_shutdown(true);
7790-
if let Some(monitor_update) = monitor_update {
7791-
pending_background_events.push(BackgroundEvent::MonitorUpdateRegeneratedOnStartup(monitor_update));
7795+
if let Some((counterparty_node_id, funding_txo, update)) = monitor_update {
7796+
pending_background_events.push(BackgroundEvent::MonitorUpdateRegeneratedOnStartup {
7797+
counterparty_node_id, funding_txo, update
7798+
});
77927799
}
77937800
failed_htlcs.append(&mut new_failed_htlcs);
77947801
channel_closures.push_back((events::Event::ChannelClosed {

0 commit comments

Comments
 (0)