@@ -871,7 +871,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
871
871
connect_blocks ( & nodes[ 0 ] , timeout_blocks + upstream_timeout_blocks) ;
872
872
873
873
// Check that nodes[1] fails the HTLC upstream
874
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
874
+ process_htlcs_and_expect_htlc_handling_failed ! (
875
875
nodes[ 1 ] ,
876
876
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
877
877
) ;
@@ -892,7 +892,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
892
892
mine_transaction ( & nodes[ 1 ] , & node_1_txn[ 1 ] ) ; // HTLC timeout
893
893
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY ) ;
894
894
// Expect handling another fail back event, but the HTLC is already gone
895
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
895
+ process_htlcs_and_expect_htlc_handling_failed ! (
896
896
nodes[ 1 ] ,
897
897
[ HTLCHandlingFailureType :: Forward {
898
898
node_id: Some ( node_c_id) ,
@@ -921,7 +921,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
921
921
} ,
922
922
PostFailBackAction :: FailOffChain => {
923
923
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
924
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
924
+ process_htlcs_and_expect_htlc_handling_failed ! (
925
925
nodes[ 2 ] ,
926
926
[ HTLCHandlingFailureType :: Receive { payment_hash } ]
927
927
) ;
@@ -2102,7 +2102,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
2102
2102
check_spends ! ( commitment_tx[ 0 ] , chan_2. 3 ) ;
2103
2103
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
2104
2104
check_added_monitors ( & nodes[ 2 ] , 0 ) ;
2105
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2105
+ process_htlcs_and_expect_htlc_handling_failed ! (
2106
2106
nodes[ 2 ] ,
2107
2107
[ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash. clone( ) } ]
2108
2108
) ;
@@ -2179,7 +2179,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
2179
2179
2180
2180
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
2181
2181
2182
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2182
+ process_htlcs_and_expect_htlc_handling_failed ! (
2183
2183
nodes[ 1 ] ,
2184
2184
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
2185
2185
) ;
@@ -2267,7 +2267,7 @@ pub fn test_simple_commitment_revoked_fail_backward() {
2267
2267
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
2268
2268
check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
2269
2269
2270
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2270
+ process_htlcs_and_expect_htlc_handling_failed ! (
2271
2271
nodes[ 1 ] ,
2272
2272
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
2273
2273
) ;
@@ -2360,7 +2360,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
2360
2360
let ( _, third_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , value) ;
2361
2361
2362
2362
nodes[ 2 ] . node . fail_htlc_backwards ( & first_payment_hash) ;
2363
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2363
+ process_htlcs_and_expect_htlc_handling_failed ! (
2364
2364
nodes[ 2 ] ,
2365
2365
[ HTLCHandlingFailureType :: Receive { payment_hash: first_payment_hash } ]
2366
2366
) ;
@@ -2377,7 +2377,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
2377
2377
// Drop the last RAA from 3 -> 2
2378
2378
2379
2379
nodes[ 2 ] . node . fail_htlc_backwards ( & second_payment_hash) ;
2380
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2380
+ process_htlcs_and_expect_htlc_handling_failed ! (
2381
2381
nodes[ 2 ] ,
2382
2382
[ HTLCHandlingFailureType :: Receive { payment_hash: second_payment_hash } ]
2383
2383
) ;
@@ -2397,7 +2397,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
2397
2397
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
2398
2398
2399
2399
nodes[ 2 ] . node . fail_htlc_backwards ( & third_payment_hash) ;
2400
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2400
+ process_htlcs_and_expect_htlc_handling_failed ! (
2401
2401
nodes[ 2 ] ,
2402
2402
[ HTLCHandlingFailureType :: Receive { payment_hash: third_payment_hash } ]
2403
2403
) ;
@@ -3706,7 +3706,7 @@ fn do_test_htlc_timeout(send_partial_mpp: bool) {
3706
3706
connect_block ( & nodes[ 1 ] , & block) ;
3707
3707
}
3708
3708
3709
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
3709
+ process_htlcs_and_expect_htlc_handling_failed ! (
3710
3710
nodes[ 1 ] ,
3711
3711
[ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
3712
3712
) ;
@@ -3787,7 +3787,7 @@ fn do_test_holding_cell_htlc_add_timeouts(forwarded_htlc: bool) {
3787
3787
if forwarded_htlc {
3788
3788
let fail_type =
3789
3789
HTLCHandlingFailureType :: Forward { node_id : Some ( node_c_id) , channel_id : chan_2. 2 } ;
3790
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
3790
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
3791
3791
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
3792
3792
let fail_commit = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
3793
3793
assert_eq ! ( fail_commit. len( ) , 1 ) ;
@@ -4570,7 +4570,7 @@ pub fn test_duplicate_payment_hash_one_failure_one_success() {
4570
4570
// Mine the HTLC timeout transaction on node B.
4571
4571
mine_transaction ( & nodes[ 1 ] , & htlc_timeout_tx) ;
4572
4572
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
4573
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
4573
+ process_htlcs_and_expect_htlc_handling_failed ! (
4574
4574
nodes[ 1 ] ,
4575
4575
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
4576
4576
) ;
@@ -4793,7 +4793,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4793
4793
HTLCHandlingFailureType :: Receive { payment_hash: hash_5 } ,
4794
4794
HTLCHandlingFailureType :: Receive { payment_hash: hash_6 } ,
4795
4795
] ;
4796
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 4 ] , failed_destinations) ;
4796
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 4 ] , failed_destinations) ;
4797
4797
check_added_monitors ( & nodes[ 4 ] , 1 ) ;
4798
4798
4799
4799
let four_removes = get_htlc_update_msgs ! ( nodes[ 4 ] , node_d_id) ;
@@ -4812,7 +4812,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4812
4812
HTLCHandlingFailureType :: Receive { payment_hash: hash_2 } ,
4813
4813
HTLCHandlingFailureType :: Receive { payment_hash: hash_4 } ,
4814
4814
] ;
4815
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 5 ] , failed_destinations_2) ;
4815
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 5 ] , failed_destinations_2) ;
4816
4816
check_added_monitors ( & nodes[ 5 ] , 1 ) ;
4817
4817
4818
4818
let two_removes = get_htlc_update_msgs ! ( nodes[ 5 ] , node_d_id) ;
@@ -4831,7 +4831,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4831
4831
HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
4832
4832
HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
4833
4833
] ;
4834
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations_3) ;
4834
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations_3) ;
4835
4835
check_added_monitors ( & nodes[ 3 ] , 1 ) ;
4836
4836
let six_removes = get_htlc_update_msgs ! ( nodes[ 3 ] , node_c_id) ;
4837
4837
nodes[ 2 ] . node . handle_update_fail_htlc ( node_d_id, & six_removes. update_fail_htlcs [ 0 ] ) ;
@@ -4911,7 +4911,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
4911
4911
. collect ( )
4912
4912
} ;
4913
4913
4914
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 2 ] , expected_destinations) ;
4914
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 2 ] , expected_destinations) ;
4915
4915
}
4916
4916
check_added_monitors ( & nodes[ 2 ] , 3 ) ;
4917
4917
@@ -5392,7 +5392,7 @@ fn do_htlc_claim_previous_remote_commitment_only(use_dust: bool, check_revoke_no
5392
5392
let htlc_value = if use_dust { 50000 } else { 3000000 } ;
5393
5393
let ( _, our_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , htlc_value) ;
5394
5394
nodes[ 1 ] . node . fail_htlc_backwards ( & our_payment_hash) ;
5395
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
5395
+ process_htlcs_and_expect_htlc_handling_failed ! (
5396
5396
nodes[ 1 ] ,
5397
5397
[ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
5398
5398
) ;
@@ -6029,7 +6029,7 @@ pub fn test_update_fulfill_htlc_bolt2_after_malformed_htlc_message_must_forward_
6029
6029
6030
6030
check_added_monitors ( & nodes[ 1 ] , 0 ) ;
6031
6031
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , update_msg. 1 , false , true ) ;
6032
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6032
+ process_htlcs_and_expect_htlc_handling_failed ! (
6033
6033
nodes[ 1 ] ,
6034
6034
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
6035
6035
) ;
@@ -6121,7 +6121,7 @@ pub fn test_channel_failed_after_message_with_badonion_node_perm_bits_set() {
6121
6121
_ => panic ! ( "Unexpected event" ) ,
6122
6122
}
6123
6123
6124
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6124
+ process_htlcs_and_expect_htlc_handling_failed ! (
6125
6125
nodes[ 1 ] ,
6126
6126
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
6127
6127
) ;
@@ -6203,7 +6203,7 @@ fn do_test_failure_delay_dust_htlc_local_commitment(announce_latest: bool) {
6203
6203
// Fail one HTLC to prune it in the will-be-latest-local commitment tx
6204
6204
nodes[ 1 ] . node . fail_htlc_backwards ( & payment_hash_2) ;
6205
6205
check_added_monitors ( & nodes[ 1 ] , 0 ) ;
6206
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6206
+ process_htlcs_and_expect_htlc_handling_failed ! (
6207
6207
nodes[ 1 ] ,
6208
6208
[ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash_2 } ]
6209
6209
) ;
@@ -6569,7 +6569,7 @@ pub fn test_check_htlc_underpaying() {
6569
6569
// Note that we first have to wait a random delay before processing the receipt of the HTLC,
6570
6570
// and then will wait a second random delay before failing the HTLC back:
6571
6571
nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
6572
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6572
+ process_htlcs_and_expect_htlc_handling_failed ! (
6573
6573
nodes[ 1 ] ,
6574
6574
[ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
6575
6575
) ;
@@ -8001,7 +8001,7 @@ pub fn test_bad_secret_hash() {
8001
8001
// We have to forward pending HTLCs once to process the receipt of the HTLC and then
8002
8002
// again to process the pending backwards-failure of the HTLC
8003
8003
nodes[ 1 ] . node. process_pending_htlc_forwards( ) ;
8004
- expect_pending_htlcs_forwardable_and_htlc_handling_failed !(
8004
+ process_htlcs_and_expect_htlc_handling_failed !(
8005
8005
nodes[ 1 ] ,
8006
8006
vec![ HTLCHandlingFailureType :: Receive { payment_hash: $payment_hash } ]
8007
8007
) ;
@@ -9416,7 +9416,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
9416
9416
& [ ( 0 , htlc_tx) ] ,
9417
9417
conf_height + 1 ,
9418
9418
) ;
9419
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9419
+ process_htlcs_and_expect_htlc_handling_failed ! (
9420
9420
nodes[ 1 ] ,
9421
9421
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
9422
9422
) ;
@@ -9446,7 +9446,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
9446
9446
// When the HTLC times out on the A<->B edge, the B<->C channel will fail the HTLC back to
9447
9447
// avoid the A<->B channel closing (even though it already has). This will generate a
9448
9448
// spurious HTLCHandlingFailed event.
9449
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9449
+ process_htlcs_and_expect_htlc_handling_failed ! (
9450
9450
nodes[ 1 ] ,
9451
9451
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
9452
9452
) ;
@@ -9699,7 +9699,7 @@ pub fn test_inconsistent_mpp_params() {
9699
9699
nodes[ 2 ] . node . handle_update_fail_htlc ( node_d_id, & fail_updates_1. update_fail_htlcs [ 0 ] ) ;
9700
9700
commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 3 ] , fail_updates_1. commitment_signed, false ) ;
9701
9701
9702
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9702
+ process_htlcs_and_expect_htlc_handling_failed ! (
9703
9703
nodes[ 2 ] ,
9704
9704
[ HTLCHandlingFailureType :: Forward { node_id: Some ( node_d_id) , channel_id: chan_2_3. 2 } ]
9705
9705
) ;
@@ -9774,7 +9774,7 @@ pub fn test_double_partial_claim() {
9774
9774
HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
9775
9775
HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
9776
9776
] ;
9777
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations) ;
9777
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations) ;
9778
9778
9779
9779
let reason = PaymentFailureReason :: RecipientRejected ;
9780
9780
pass_failed_payment_back ( & nodes[ 0 ] , paths, false , hash, reason) ;
@@ -10759,7 +10759,7 @@ fn do_payment_with_custom_min_final_cltv_expiry(valid_delta: bool, use_user_hash
10759
10759
claim_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_preimage) ;
10760
10760
} else {
10761
10761
let fail_type = HTLCHandlingFailureType :: Receive { payment_hash : hash } ;
10762
- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
10762
+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
10763
10763
10764
10764
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
10765
10765
0 commit comments