1- #![ cfg_attr( rustfmt, rustfmt_skip) ]
2-
31// This file is Copyright its original authors, visible in version control
42// history.
53//
1311
1412use bitcoin:: block:: { Block , Header } ;
1513use bitcoin:: constants:: genesis_block;
16- use bitcoin:: script:: { Script , ScriptBuf } ;
1714use bitcoin:: hash_types:: { BlockHash , Txid } ;
1815use bitcoin:: network:: Network ;
16+ use bitcoin:: script:: { Script , ScriptBuf } ;
1917use bitcoin:: secp256k1:: PublicKey ;
2018
2119use crate :: chain:: channelmonitor:: { ChannelMonitor , ChannelMonitorUpdate , MonitorEvent } ;
22- use crate :: ln:: types:: ChannelId ;
23- use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
2420use crate :: chain:: transaction:: { OutPoint , TransactionData } ;
2521use crate :: impl_writeable_tlv_based;
22+ use crate :: ln:: types:: ChannelId ;
23+ use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
2624
2725#[ allow( unused_imports) ]
2826use crate :: prelude:: * ;
2927
3028pub mod chaininterface;
3129pub mod chainmonitor;
3230pub mod channelmonitor;
33- pub mod transaction;
3431pub ( crate ) mod onchaintx;
3532pub ( crate ) mod package;
33+ pub mod transaction;
3634
3735/// The best known block as identified by its hash and height.
3836#[ derive( Clone , Copy , Debug , Hash , PartialEq , Eq ) ]
@@ -47,10 +45,7 @@ impl BestBlock {
4745 /// Constructs a `BestBlock` that represents the genesis block at height 0 of the given
4846 /// network.
4947 pub fn from_network ( network : Network ) -> Self {
50- BestBlock {
51- block_hash : genesis_block ( network) . header . block_hash ( ) ,
52- height : 0 ,
53- }
48+ BestBlock { block_hash : genesis_block ( network) . header . block_hash ( ) , height : 0 }
5449 }
5550
5651 /// Returns a `BestBlock` as identified by the given block hash and height.
@@ -67,7 +62,6 @@ impl_writeable_tlv_based!(BestBlock, {
6762 ( 2 , height, required) ,
6863} ) ;
6964
70-
7165/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the
7266/// chain.
7367///
@@ -289,7 +283,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
289283 /// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
290284 /// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
291285 /// [`block_disconnected`]: channelmonitor::ChannelMonitor::block_disconnected
292- fn watch_channel ( & self , channel_id : ChannelId , monitor : ChannelMonitor < ChannelSigner > ) -> Result < ChannelMonitorUpdateStatus , ( ) > ;
286+ fn watch_channel (
287+ & self , channel_id : ChannelId , monitor : ChannelMonitor < ChannelSigner > ,
288+ ) -> Result < ChannelMonitorUpdateStatus , ( ) > ;
293289
294290 /// Updates a channel identified by `channel_id` by applying `update` to its monitor.
295291 ///
@@ -306,7 +302,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
306302 /// [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
307303 ///
308304 /// [`ChannelManager`]: crate::ln::channelmanager::ChannelManager
309- fn update_channel ( & self , channel_id : ChannelId , update : & ChannelMonitorUpdate ) -> ChannelMonitorUpdateStatus ;
305+ fn update_channel (
306+ & self , channel_id : ChannelId , update : & ChannelMonitorUpdate ,
307+ ) -> ChannelMonitorUpdateStatus ;
310308
311309 /// Returns any monitor events since the last call. Subsequent calls must only return new
312310 /// events.
@@ -317,7 +315,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
317315 ///
318316 /// For details on asynchronous [`ChannelMonitor`] updating and returning
319317 /// [`MonitorEvent::Completed`] here, see [`ChannelMonitorUpdateStatus::InProgress`].
320- fn release_pending_monitor_events ( & self ) -> Vec < ( OutPoint , ChannelId , Vec < MonitorEvent > , PublicKey ) > ;
318+ fn release_pending_monitor_events (
319+ & self ,
320+ ) -> Vec < ( OutPoint , ChannelId , Vec < MonitorEvent > , PublicKey ) > ;
321321}
322322
323323/// The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
0 commit comments