@@ -44,7 +44,9 @@ use std::mem;
44
44
use std:: collections:: HashMap ;
45
45
46
46
pub const CHAN_CONFIRM_DEPTH : u32 = 100 ;
47
- pub fn confirm_transaction < ' a , ' b : ' a > ( notifier : & ' a chaininterface:: BlockNotifierRef < ' b > , tx : & Transaction ) {
47
+
48
+ pub fn confirm_transaction < ' a , ' b , ' c , ' d > ( node : & ' a Node < ' b , ' c , ' d > , tx : & Transaction ) {
49
+ let notifier = & node. block_notifier ;
48
50
let dummy_tx = Transaction { version : 0 , lock_time : 0 , input : Vec :: new ( ) , output : Vec :: new ( ) } ;
49
51
let dummy_tx_count = tx. version as usize ;
50
52
let mut block = Block {
@@ -62,7 +64,8 @@ pub fn confirm_transaction<'a, 'b: 'a>(notifier: &'a chaininterface::BlockNotifi
62
64
}
63
65
}
64
66
65
- pub fn connect_blocks < ' a , ' b > ( notifier : & ' a chaininterface:: BlockNotifierRef < ' b > , depth : u32 , height : u32 , parent : bool , prev_blockhash : BlockHash ) -> BlockHash {
67
+ pub fn connect_blocks < ' a , ' b , ' c , ' d > ( node : & ' a Node < ' b , ' c , ' d > , depth : u32 , height : u32 , parent : bool , prev_blockhash : BlockHash ) -> BlockHash {
68
+ let notifier = & node. block_notifier ;
66
69
let mut block = Block {
67
70
header : BlockHeader { version : 0x2000000 , prev_blockhash : if parent { prev_blockhash } else { Default :: default ( ) } , merkle_root : Default :: default ( ) , time : 42 , bits : 42 , nonce : 42 } ,
68
71
txdata : vec ! [ ] ,
@@ -387,7 +390,7 @@ pub fn create_chan_between_nodes_with_value_init<'a, 'b, 'c>(node_a: &Node<'a, '
387
390
}
388
391
389
392
pub fn create_chan_between_nodes_with_value_confirm_first < ' a , ' b , ' c , ' d > ( node_recv : & ' a Node < ' b , ' c , ' c > , node_conf : & ' a Node < ' b , ' c , ' d > , tx : & Transaction ) {
390
- confirm_transaction ( & node_conf. block_notifier , & tx) ;
393
+ confirm_transaction ( node_conf, tx) ;
391
394
node_recv. node . handle_funding_locked ( & node_conf. node . get_our_node_id ( ) , & get_event_msg ! ( node_conf, MessageSendEvent :: SendFundingLocked , node_recv. node. get_our_node_id( ) ) ) ;
392
395
}
393
396
@@ -413,7 +416,7 @@ pub fn create_chan_between_nodes_with_value_confirm_second<'a, 'b, 'c>(node_recv
413
416
414
417
pub fn create_chan_between_nodes_with_value_confirm < ' a , ' b , ' c , ' d > ( node_a : & ' a Node < ' b , ' c , ' d > , node_b : & ' a Node < ' b , ' c , ' d > , tx : & Transaction ) -> ( ( msgs:: FundingLocked , msgs:: AnnouncementSignatures ) , [ u8 ; 32 ] ) {
415
418
create_chan_between_nodes_with_value_confirm_first ( node_a, node_b, tx) ;
416
- confirm_transaction ( & node_a. block_notifier , & tx) ;
419
+ confirm_transaction ( node_a, tx) ;
417
420
create_chan_between_nodes_with_value_confirm_second ( node_b, node_a)
418
421
}
419
422
0 commit comments