1
- #![ cfg_attr( rustfmt, rustfmt_skip) ]
2
-
3
1
// This file is Copyright its original authors, visible in version control
4
2
// history.
5
3
//
13
11
14
12
use bitcoin:: block:: { Block , Header } ;
15
13
use bitcoin:: constants:: genesis_block;
16
- use bitcoin:: script:: { Script , ScriptBuf } ;
17
14
use bitcoin:: hash_types:: { BlockHash , Txid } ;
18
15
use bitcoin:: network:: Network ;
16
+ use bitcoin:: script:: { Script , ScriptBuf } ;
19
17
use bitcoin:: secp256k1:: PublicKey ;
20
18
21
19
use crate :: chain:: channelmonitor:: { ChannelMonitor , ChannelMonitorUpdate , MonitorEvent } ;
22
- use crate :: ln:: types:: ChannelId ;
23
- use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
24
20
use crate :: chain:: transaction:: { OutPoint , TransactionData } ;
25
21
use crate :: impl_writeable_tlv_based;
22
+ use crate :: ln:: types:: ChannelId ;
23
+ use crate :: sign:: ecdsa:: EcdsaChannelSigner ;
26
24
27
25
#[ allow( unused_imports) ]
28
26
use crate :: prelude:: * ;
29
27
30
28
pub mod chaininterface;
31
29
pub mod chainmonitor;
32
30
pub mod channelmonitor;
33
- pub mod transaction;
34
31
pub ( crate ) mod onchaintx;
35
32
pub ( crate ) mod package;
33
+ pub mod transaction;
36
34
37
35
/// The best known block as identified by its hash and height.
38
36
#[ derive( Clone , Copy , Debug , Hash , PartialEq , Eq ) ]
@@ -47,10 +45,7 @@ impl BestBlock {
47
45
/// Constructs a `BestBlock` that represents the genesis block at height 0 of the given
48
46
/// network.
49
47
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 }
54
49
}
55
50
56
51
/// Returns a `BestBlock` as identified by the given block hash and height.
@@ -67,7 +62,6 @@ impl_writeable_tlv_based!(BestBlock, {
67
62
( 2 , height, required) ,
68
63
} ) ;
69
64
70
-
71
65
/// The `Listen` trait is used to notify when blocks have been connected or disconnected from the
72
66
/// chain.
73
67
///
@@ -289,7 +283,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
289
283
/// [`get_outputs_to_watch`]: channelmonitor::ChannelMonitor::get_outputs_to_watch
290
284
/// [`block_connected`]: channelmonitor::ChannelMonitor::block_connected
291
285
/// [`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 , ( ) > ;
293
289
294
290
/// Updates a channel identified by `channel_id` by applying `update` to its monitor.
295
291
///
@@ -306,7 +302,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
306
302
/// [`ChannelMonitorUpdateStatus::UnrecoverableError`], see its documentation for more info.
307
303
///
308
304
/// [`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 ;
310
308
311
309
/// Returns any monitor events since the last call. Subsequent calls must only return new
312
310
/// events.
@@ -317,7 +315,9 @@ pub trait Watch<ChannelSigner: EcdsaChannelSigner> {
317
315
///
318
316
/// For details on asynchronous [`ChannelMonitor`] updating and returning
319
317
/// [`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 ) > ;
321
321
}
322
322
323
323
/// The `Filter` trait defines behavior for indicating chain activity of interest pertaining to
0 commit comments