13
13
//! here. See also the chanmon_fail_consistency fuzz test.
14
14
15
15
use 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 ;
18
17
use crate :: chain:: channelmonitor:: { ANTI_REORG_DELAY , ChannelMonitor } ;
19
18
use crate :: chain:: transaction:: OutPoint ;
20
19
use crate :: chain:: { ChannelMonitorUpdateStatus , Listen , Watch } ;
@@ -1107,7 +1106,7 @@ fn test_monitor_update_fail_reestablish() {
1107
1106
assert ! ( updates. update_fee. is_none( ) ) ;
1108
1107
assert_eq ! ( updates. update_fulfill_htlcs. len( ) , 1 ) ;
1109
1108
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 ) ;
1111
1110
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1112
1111
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1113
1112
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , updates. commitment_signed, false ) ;
@@ -2153,7 +2152,7 @@ fn test_fail_htlc_on_broadcast_after_claim() {
2153
2152
nodes[ 1 ] . node . handle_update_fulfill_htlc ( & nodes[ 2 ] . node . get_our_node_id ( ) , & cs_updates. update_fulfill_htlcs [ 0 ] ) ;
2154
2153
let bs_updates = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
2155
2154
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 ) ;
2157
2156
2158
2157
mine_transaction ( & nodes[ 1 ] , & bs_txn[ 0 ] ) ;
2159
2158
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
2526
2525
assert_eq ! ( fulfill_msg, cs_updates. update_fulfill_htlcs[ 0 ] ) ;
2527
2526
}
2528
2527
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 ) ;
2530
2529
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
2531
2530
2532
2531
let mut bs_updates = None ;
@@ -3156,7 +3155,7 @@ fn do_test_inverted_mon_completion_order(with_latest_manager: bool, complete_bc_
3156
3155
nodes[ 0 ] . node . handle_update_fulfill_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & bs_updates. update_fulfill_htlcs [ 0 ] ) ;
3157
3156
do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & bs_updates. commitment_signed , false , false ) ;
3158
3157
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) ;
3160
3159
3161
3160
// Finally, check that the payment was, ultimately, seen as sent by node A.
3162
3161
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,
3287
3286
} else {
3288
3287
// While we forwarded the payment a while ago, we don't want to process events too early or
3289
3288
// 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) ;
3291
3290
}
3292
3291
3293
3292
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,
3310
3309
reconnect_nodes ( reconnect_args) ;
3311
3310
let ( outpoint, ab_update_id, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_id_ab) . unwrap ( ) . clone ( ) ;
3312
3311
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 ) ;
3314
3313
if !close_chans_before_reload {
3315
3314
// Once we call `process_pending_events` the final `ChannelMonitor` for the B<->C
3316
3315
// 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) {
3404
3403
let bc_update_id = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_id_bc) . unwrap ( ) . 2 ;
3405
3404
let mut events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
3406
3405
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 ) ;
3408
3408
if close_during_reload {
3409
3409
match events[ 0 ] {
3410
3410
Event :: ChannelClosed { .. } => { } ,
@@ -3478,7 +3478,7 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
3478
3478
reconnect_nodes ( reconnect) ;
3479
3479
3480
3480
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 ) ;
3482
3482
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 100_000 ) ;
3483
3483
} else {
3484
3484
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) . is_empty( ) ) ;
0 commit comments