Skip to content

Commit 233b3c2

Browse files
committed
f - add higher level docs on Persist trait
1 parent ec310b8 commit 233b3c2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

lightning/src/chain/chainmonitor.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ impl MonitorUpdateId {
9494
/// [`ChannelMonitorUpdateStatus::PermanentFailure`], in which case the channel will likely be
9595
/// closed without broadcasting the latest state. See
9696
/// [`ChannelMonitorUpdateStatus::PermanentFailure`] for more details.
97+
///
98+
/// Third-party watchtowers may be built as a part of an implementation of this trait, with the
99+
/// advantage that you can control whether to resume channel operation depending on if an update
100+
/// has been persisted to a watchtower. For this, you may find the following methods useful:
101+
/// [`ChannelMonitor::initial_counterparty_commitment_tx`],
102+
/// [`ChannelMonitor::counterparty_commitment_txs_from_update`],
103+
/// [`ChannelMonitor::sign_justice_tx`], [`CommitmentTransaction::revokeable_output_index`],
104+
/// [`CommitmentTransaction::build_to_local_justice_tx`].
105+
///
106+
/// [`CommitmentTransaction::revokeable_output_index`]: crate::ln::chan_utils::CommitmentTransaction::revokeable_output_index
107+
/// [`CommitmentTransaction::build_to_local_justice_tx`]: crate::ln::chan_utils::CommitmentTransaction::build_to_local_justice_tx
97108
pub trait Persist<ChannelSigner: WriteableEcdsaChannelSigner> {
98109
/// Persist a new channel's data in response to a [`chain::Watch::watch_channel`] call. This is
99110
/// called by [`ChannelManager`] for new channels, or may be called directly, e.g. on startup.

0 commit comments

Comments
 (0)