Skip to content

Minor doc tweaks to MonitorHolder #3230

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lightning/src/chain/chainmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,15 @@ struct MonitorHolder<ChannelSigner: EcdsaChannelSigner> {
/// Note that this lock must be held from [`ChannelMonitor::update_monitor`] through to
/// [`Persist::update_persisted_channel`] to prevent a race where we call
/// [`Persist::update_persisted_channel`], the user returns a
/// [`ChannelMonitorUpdateStatus::InProgress`], and then calls channel_monitor_updated
/// immediately, racing our insertion of the pending update into the contained Vec.
/// [`ChannelMonitorUpdateStatus::InProgress`], and then calls
/// [`ChainMonitor::channel_monitor_updated`] immediately, racing our insertion of the pending
/// update into the contained Vec.
///
/// This also avoids a race where we update a [`ChannelMonitor`], then while connecting a block
/// persist a full [`ChannelMonitor`] prior to persisting the [`ChannelMonitorUpdate`]. This
/// could cause users to have a full [`ChannelMonitor`] on disk as well as a
/// [`ChannelMonitorUpdate`] which was already applied. While this isn't an issue for the
/// LDK-provided update-based [`Persist`], its somewhat surprising for users so we avoid it.
/// LDK-provided update-based [`Persist`], it is somewhat surprising for users so we avoid it.
pending_monitor_updates: Mutex<Vec<u64>>,
}

Expand Down
Loading