Skip to content

Commit

Permalink
f highlight that idempotency is technically only necessary absent ato…
Browse files Browse the repository at this point in the history
…micity
  • Loading branch information
arik-so committed Oct 11, 2024
1 parent 1d3b771 commit 8d0dda5
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lightning/src/chain/chainmonitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,12 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
/// Archiving the data in a backup location (rather than deleting it fully) is useful for
/// hedging against data loss in case of unexpected failure.
///
/// Note that if a crash occurs during the archiving process, a state may emerge with the
/// archival operation only being partially complete. In that scenario, the monitor may still be
/// loaded on startup pending successful completion of the archive process. Additionally,
/// because the archive operation could be retried on restart, this method must be idempotent,
/// ensuring it can handle scenarios where the monitor already exists in the archive.
/// Note that if a crash occurs during the archiving process, and its implementation is not
/// atomic, a state may emerge with the archival operation only being partially complete. In
/// that scenario, the monitor may still be loaded on startup pending successful completion of
/// the archive process. Additionally, because the archive operation could be retried on
/// restart, this method must in that case be idempotent, ensuring it can handle scenarios where
/// the monitor already exists in the archive.
fn archive_persisted_channel(&self, channel_funding_outpoint: OutPoint);
}

Expand Down

0 comments on commit 8d0dda5

Please sign in to comment.