1313//! here. See also the chanmon_fail_consistency fuzz test.
1414
1515use bitcoin:: blockdata:: constants:: genesis_block;
16- use bitcoin:: hash_types:: BlockHash ;
17- use bitcoin:: network:: constants:: Network ;
16+ use bitcoin:: hash_types:: BlockHash ; use bitcoin:: network:: constants:: Network ;
1817use crate :: chain:: channelmonitor:: { ANTI_REORG_DELAY , ChannelMonitor } ;
1918use crate :: chain:: transaction:: OutPoint ;
2019use crate :: chain:: { ChannelMonitorUpdateStatus , Listen , Watch } ;
@@ -1107,7 +1106,7 @@ fn test_monitor_update_fail_reestablish() {
11071106 assert ! ( updates. update_fee. is_none( ) ) ;
11081107 assert_eq ! ( updates. update_fulfill_htlcs. len( ) , 1 ) ;
11091108 nodes[ 1 ] . node . handle_update_fulfill_htlc ( & nodes[ 2 ] . node . get_our_node_id ( ) , & updates. update_fulfill_htlcs [ 0 ] ) ;
1110- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , None , false , false ) ;
1109+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
11111110 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
11121111 assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
11131112 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , updates. commitment_signed, false ) ;
@@ -2153,7 +2152,7 @@ fn test_fail_htlc_on_broadcast_after_claim() {
21532152 nodes[ 1 ] . node . handle_update_fulfill_htlc ( & nodes[ 2 ] . node . get_our_node_id ( ) , & cs_updates. update_fulfill_htlcs [ 0 ] ) ;
21542153 let bs_updates = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
21552154 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
2156- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , None , false , false ) ;
2155+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
21572156
21582157 mine_transaction ( & nodes[ 1 ] , & bs_txn[ 0 ] ) ;
21592158 check_closed_event ! ( nodes[ 1 ] , 1 , ClosureReason :: CommitmentTxConfirmed , [ nodes[ 2 ] . node. get_our_node_id( ) ] , 100000 ) ;
@@ -2526,7 +2525,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
25262525 assert_eq ! ( fulfill_msg, cs_updates. update_fulfill_htlcs[ 0 ] ) ;
25272526 }
25282527 nodes[ 1 ] . node . handle_update_fulfill_htlc ( & nodes[ 2 ] . node . get_our_node_id ( ) , & fulfill_msg) ;
2529- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , None , false , false ) ;
2528+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
25302529 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
25312530
25322531 let mut bs_updates = None ;
@@ -3156,7 +3155,7 @@ fn do_test_inverted_mon_completion_order(with_latest_manager: bool, complete_bc_
31563155 nodes[ 0 ] . node . handle_update_fulfill_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & bs_updates. update_fulfill_htlcs [ 0 ] ) ;
31573156 do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & bs_updates. commitment_signed , false , false ) ;
31583157
3159- expect_payment_forwarded ! ( nodes[ 1 ] , & nodes[ 0 ] , & nodes[ 2 ] , Some ( 1_000 ) , None , false , !with_latest_manager) ;
3158+ expect_payment_forwarded ! ( nodes[ 1 ] , & nodes[ 0 ] , & nodes[ 2 ] , Some ( 1_000 ) , false , !with_latest_manager) ;
31603159
31613160 // Finally, check that the payment was, ultimately, seen as sent by node A.
31623161 expect_payment_sent ( & nodes[ 0 ] , payment_preimage, None , true , true ) ;
@@ -3287,7 +3286,7 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
32873286 } else {
32883287 // While we forwarded the payment a while ago, we don't want to process events too early or
32893288 // we'll run background tasks we wanted to test individually.
3290- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , None , None , true , !close_only_a) ;
3289+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , None , true , !close_only_a) ;
32913290 }
32923291
32933292 mine_transactions ( & nodes[ 0 ] , & [ & as_closing_tx[ 0 ] , bs_preimage_tx] ) ;
@@ -3310,7 +3309,7 @@ fn do_test_durable_preimages_on_closed_channel(close_chans_before_reload: bool,
33103309 reconnect_nodes ( reconnect_args) ;
33113310 let ( outpoint, ab_update_id, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_id_ab) . unwrap ( ) . clone ( ) ;
33123311 nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, ab_update_id) ;
3313- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , None , true , false ) ;
3312+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , true , false ) ;
33143313 if !close_chans_before_reload {
33153314 // Once we call `process_pending_events` the final `ChannelMonitor` for the B<->C
33163315 // channel will fly, removing the payment preimage from it.
@@ -3404,7 +3403,8 @@ fn do_test_reload_mon_update_completion_actions(close_during_reload: bool) {
34043403 let bc_update_id = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_id_bc) . unwrap ( ) . 2 ;
34053404 let mut events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
34063405 assert_eq ! ( events. len( ) , if close_during_reload { 2 } else { 1 } ) ;
3407- expect_payment_forwarded ( events. pop ( ) . unwrap ( ) , & nodes[ 1 ] , & nodes[ 0 ] , & nodes[ 2 ] , Some ( 1000 ) , None , close_during_reload, false ) ;
3406+ expect_payment_forwarded ( events. pop ( ) . unwrap ( ) , & nodes[ 1 ] , & nodes[ 0 ] , & nodes[ 2 ] , Some ( 1000 ) ,
3407+ None , close_during_reload, false ) ;
34083408 if close_during_reload {
34093409 match events[ 0 ] {
34103410 Event :: ChannelClosed { .. } => { } ,
@@ -3478,7 +3478,7 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
34783478 reconnect_nodes ( reconnect) ;
34793479
34803480 if !hold_chan_a {
3481- expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , None , false , false ) ;
3481+ expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
34823482 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 100_000 ) ;
34833483 } else {
34843484 assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
0 commit comments