Skip to content

Minor doc nits on the new coop close reason variants #2876

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
Feb 6, 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
5 changes: 5 additions & 0 deletions lightning/src/events/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,16 @@ pub enum ClosureReason {
HolderForceClosed,
/// The channel was closed after negotiating a cooperative close and we've now broadcasted
/// the cooperative close transaction. Note the shutdown may have been initiated by us.
///
/// This was only set in versions of LDK prior to 0.0.122.
// Can be removed once we disallow downgrading to 0.0.121
LegacyCooperativeClosure,
/// The channel was closed after negotiating a cooperative close and we've now broadcasted
/// the cooperative close transaction. This indicates that the shutdown was initiated by our
/// counterparty.
///
/// In rare cases where we initiated closure immediately prior to shutting down without
/// persisting, this value may be provided for channels we initiated closure for.
Comment on lines +187 to +196
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments for LegacyCooperativeClosure, CounterpartyInitiatedCooperativeClosure, and LocallyInitiatedCooperativeClosure variants in the ClosureReason enum do not provide clear, distinct explanations for each variant. This can lead to confusion about the specific circumstances under which each variant is used.

Consider refining the comments to clearly distinguish between the scenarios that lead to each cooperative closure variant being used.

CounterpartyInitiatedCooperativeClosure,
/// The channel was closed after negotiating a cooperative close and we've now broadcasted
/// the cooperative close transaction. This indicates that the shutdown was initiated by us.
Expand Down