X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=src%2Fln%2Fchannelmonitor.rs;h=39146daa9b2d96e6f93f5251c76e0f77353e72fb;hb=3b498378620d4294f188804c97497112e3693297;hp=cb2aba780a5862ae48ba87bc77db4f07b837e0eb;hpb=6c07555cad1d8500dca3fd11ab736d4e5c84f8c2;p=rust-lightning diff --git a/src/ln/channelmonitor.rs b/src/ln/channelmonitor.rs index cb2aba78..39146daa 100644 --- a/src/ln/channelmonitor.rs +++ b/src/ln/channelmonitor.rs @@ -46,10 +46,11 @@ pub enum ChannelMonitorUpdateErr { /// channel's monitor everywhere (including remote watchtowers) *before* this function returns. If /// an update occurs and a remote watchtower is left with old state, it may broadcast transactions /// which we have revoked, allowing our counterparty to claim all funds in the channel! -/// A call to add_update_monitor is needed to register outpoint and its txid with ChainWatchInterface -/// after setting funding_txo in a ChannelMonitor pub trait ManyChannelMonitor: Send + Sync { /// Adds or updates a monitor for the given `funding_txo`. + /// Implementor must also ensure that the funding_txo outpoint is registered with any relevant + /// ChainWatchInterfaces such that the provided monitor receives block_connected callbacks with + /// any spends of it. fn add_update_monitor(&self, funding_txo: OutPoint, monitor: ChannelMonitor) -> Result<(), ChannelMonitorUpdateErr>; } @@ -471,7 +472,7 @@ impl ChannelMonitor { /// optional, without it this monitor cannot be used in an SPV client, but you may wish to /// avoid this (or call unset_funding_info) on a monitor you wish to send to a watchtower as it /// provides slightly better privacy. - /// It's the responsability of the caller to register outpoint and script with passing the former + /// It's the responsibility of the caller to register outpoint and script with passing the former /// value as key to add_update_monitor. pub(super) fn set_funding_info(&mut self, funding_info: (OutPoint, Script)) { self.funding_txo = Some(funding_info);