Skip to content

Commit c2bbeb5

Browse files
committed
Update add_update_monitor docs to indicate registration req.
It wasn't entirely clear from the existing docs that it is the responsibility of the implementor of ManyChannelMonitor to register the relevant outpoint.
1 parent beee006 commit c2bbeb5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/ln/channelmonitor.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@ pub enum ChannelMonitorUpdateErr {
4646
/// channel's monitor everywhere (including remote watchtowers) *before* this function returns. If
4747
/// an update occurs and a remote watchtower is left with old state, it may broadcast transactions
4848
/// which we have revoked, allowing our counterparty to claim all funds in the channel!
49-
/// A call to add_update_monitor is needed to register outpoint and its txid with ChainWatchInterface
50-
/// after setting funding_txo in a ChannelMonitor
5149
pub trait ManyChannelMonitor: Send + Sync {
5250
/// Adds or updates a monitor for the given `funding_txo`.
51+
/// Implementor must also ensure that the funding_txo outpoint is registered with any relevant
52+
/// ChainWatchInterfaces such that the provided monitor receives block_connected callbacks with
53+
/// any spends of it.
5354
fn add_update_monitor(&self, funding_txo: OutPoint, monitor: ChannelMonitor) -> Result<(), ChannelMonitorUpdateErr>;
5455
}
5556

@@ -471,7 +472,7 @@ impl ChannelMonitor {
471472
/// optional, without it this monitor cannot be used in an SPV client, but you may wish to
472473
/// avoid this (or call unset_funding_info) on a monitor you wish to send to a watchtower as it
473474
/// provides slightly better privacy.
474-
/// It's the responsability of the caller to register outpoint and script with passing the former
475+
/// It's the responsibility of the caller to register outpoint and script with passing the former
475476
/// value as key to add_update_monitor.
476477
pub(super) fn set_funding_info(&mut self, funding_info: (OutPoint, Script)) {
477478
self.funding_txo = Some(funding_info);

0 commit comments

Comments
 (0)