Skip to content

Commit 0db051b

Browse files
authored
Merge pull request #3329 from arik-so/monitor_archive_docs_followup
Document monitor archival idempotency requirement (#3276 followup)
2 parents 6004ee5 + 268675a commit 0db051b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lightning/src/chain/chainmonitor.rs

+7
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ pub trait Persist<ChannelSigner: EcdsaChannelSigner> {
162162
///
163163
/// Archiving the data in a backup location (rather than deleting it fully) is useful for
164164
/// hedging against data loss in case of unexpected failure.
165+
///
166+
/// Note that if a crash occurs during the archiving process, and its implementation is not
167+
/// atomic, a state may emerge with the archival operation only being partially complete. In
168+
/// that scenario, the monitor may still be loaded on startup pending successful completion of
169+
/// the archive process. Additionally, because the archive operation could be retried on
170+
/// restart, this method must in that case be idempotent, ensuring it can handle scenarios where
171+
/// the monitor already exists in the archive.
165172
fn archive_persisted_channel(&self, channel_funding_outpoint: OutPoint);
166173
}
167174

0 commit comments

Comments
 (0)