Use local channel state when constructing routes in test macro
[rust-lightning] / lightning / src / chain / mod.rs
index 2e1eaea4e5f5b7d54c9828f4b6db769388f0ec89..718990c4557bc30676179e13bc3afecbbec07e06 100644 (file)
@@ -38,7 +38,8 @@ pub struct BestBlock {
 }
 
 impl BestBlock {
-       /// Returns the best block from the genesis of the given network.
+       /// Constructs a `BestBlock` that represents the genesis block at height 0 of the given
+       /// network.
        pub fn from_genesis(network: Network) -> Self {
                BestBlock {
                        block_hash: genesis_block(network).header.block_hash(),
@@ -46,7 +47,7 @@ impl BestBlock {
                }
        }
 
-       /// Returns the best block as identified by the given block hash and height.
+       /// Returns a `BestBlock` as identified by the given block hash and height.
        pub fn new(block_hash: BlockHash, height: u32) -> Self {
                BestBlock { block_hash, height }
        }
@@ -202,6 +203,9 @@ pub trait Watch<ChannelSigner: Sign> {
        /// with any spends of outputs returned by [`get_outputs_to_watch`]. In practice, this means
        /// calling [`block_connected`] and [`block_disconnected`] on the monitor.
        ///
+       /// Note: this interface MUST error with `ChannelMonitorUpdateErr::PermanentFailure` if
+       /// the given `funding_txo` has previously been registered via `watch_channel`.
+       ///
        /// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
        /// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
        /// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected