Skip to content

Commit bde998c

Browse files
committed
f clarify comment some - we cannot prevent duplicate events period, but we CAN only have *either* pre-event state or have the event and not both, which is the issue
1 parent bf544f0 commit bde998c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lightning/src/chain/channelmonitor.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,8 @@ pub(crate) struct ChannelMonitorImpl<Signer: Sign> {
628628
// data processing. This prevents a race in ChainMonitor::update_channel (and presumably user
629629
// implementations thereof as well) where we update the in-memory channel object, then before
630630
// the persistence finishes (as its all under a read-lock), we return pending events to the
631-
// user or to the relevant ChannelManager. This could cause duplicate events.
631+
// user or to the relevant ChannelManager. Then, on reload, we'll have the pre-event state
632+
// here, but have processed the event in the ChannelManager.
632633
// Note that because the `event_lock` in `ChainMonitor` is only taken in
633634
// block/transaction-connected events and *not* during block/transaction-disconnected events,
634635
// we further MUST NOT generate events during block/transaction-disconnection.

0 commit comments

Comments
 (0)