@@ -871,7 +871,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
871871 connect_blocks ( & nodes[ 0 ] , timeout_blocks + upstream_timeout_blocks) ;
872872
873873 // 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 ! (
875875 nodes[ 1 ] ,
876876 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
877877 ) ;
@@ -892,7 +892,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
892892 mine_transaction ( & nodes[ 1 ] , & node_1_txn[ 1 ] ) ; // HTLC timeout
893893 connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY ) ;
894894 // 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 ! (
896896 nodes[ 1 ] ,
897897 [ HTLCHandlingFailureType :: Forward {
898898 node_id: Some ( node_c_id) ,
@@ -921,7 +921,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
921921 } ,
922922 PostFailBackAction :: FailOffChain => {
923923 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 ! (
925925 nodes[ 2 ] ,
926926 [ HTLCHandlingFailureType :: Receive { payment_hash } ]
927927 ) ;
@@ -2084,7 +2084,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
20842084 check_spends ! ( commitment_tx[ 0 ] , chan_2. 3 ) ;
20852085 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
20862086 check_added_monitors ( & nodes[ 2 ] , 0 ) ;
2087- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2087+ process_htlcs_and_expect_htlc_handling_failed ! (
20882088 nodes[ 2 ] ,
20892089 [ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash. clone( ) } ]
20902090 ) ;
@@ -2161,7 +2161,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
21612161
21622162 connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
21632163
2164- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2164+ process_htlcs_and_expect_htlc_handling_failed ! (
21652165 nodes[ 1 ] ,
21662166 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
21672167 ) ;
@@ -2249,7 +2249,7 @@ pub fn test_simple_commitment_revoked_fail_backward() {
22492249 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
22502250 check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
22512251
2252- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2252+ process_htlcs_and_expect_htlc_handling_failed ! (
22532253 nodes[ 1 ] ,
22542254 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
22552255 ) ;
@@ -2342,7 +2342,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23422342 let ( _, third_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , value) ;
23432343
23442344 nodes[ 2 ] . node . fail_htlc_backwards ( & first_payment_hash) ;
2345- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2345+ process_htlcs_and_expect_htlc_handling_failed ! (
23462346 nodes[ 2 ] ,
23472347 [ HTLCHandlingFailureType :: Receive { payment_hash: first_payment_hash } ]
23482348 ) ;
@@ -2359,7 +2359,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23592359 // Drop the last RAA from 3 -> 2
23602360
23612361 nodes[ 2 ] . node . fail_htlc_backwards ( & second_payment_hash) ;
2362- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2362+ process_htlcs_and_expect_htlc_handling_failed ! (
23632363 nodes[ 2 ] ,
23642364 [ HTLCHandlingFailureType :: Receive { payment_hash: second_payment_hash } ]
23652365 ) ;
@@ -2379,7 +2379,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23792379 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
23802380
23812381 nodes[ 2 ] . node . fail_htlc_backwards ( & third_payment_hash) ;
2382- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2382+ process_htlcs_and_expect_htlc_handling_failed ! (
23832383 nodes[ 2 ] ,
23842384 [ HTLCHandlingFailureType :: Receive { payment_hash: third_payment_hash } ]
23852385 ) ;
@@ -3685,7 +3685,7 @@ fn do_test_htlc_timeout(send_partial_mpp: bool) {
36853685 connect_block ( & nodes[ 1 ] , & block) ;
36863686 }
36873687
3688- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
3688+ process_htlcs_and_expect_htlc_handling_failed ! (
36893689 nodes[ 1 ] ,
36903690 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
36913691 ) ;
@@ -3766,7 +3766,7 @@ fn do_test_holding_cell_htlc_add_timeouts(forwarded_htlc: bool) {
37663766 if forwarded_htlc {
37673767 let fail_type =
37683768 HTLCHandlingFailureType :: Forward { node_id : Some ( node_c_id) , channel_id : chan_2. 2 } ;
3769- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
3769+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
37703770 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
37713771 let fail_commit = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
37723772 assert_eq ! ( fail_commit. len( ) , 1 ) ;
@@ -4555,7 +4555,7 @@ pub fn test_duplicate_payment_hash_one_failure_one_success() {
45554555 // Mine the HTLC timeout transaction on node B.
45564556 mine_transaction ( & nodes[ 1 ] , & htlc_timeout_tx) ;
45574557 connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
4558- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
4558+ process_htlcs_and_expect_htlc_handling_failed ! (
45594559 nodes[ 1 ] ,
45604560 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
45614561 ) ;
@@ -4778,7 +4778,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
47784778 HTLCHandlingFailureType :: Receive { payment_hash: hash_5 } ,
47794779 HTLCHandlingFailureType :: Receive { payment_hash: hash_6 } ,
47804780 ] ;
4781- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 4 ] , failed_destinations) ;
4781+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 4 ] , failed_destinations) ;
47824782 check_added_monitors ( & nodes[ 4 ] , 1 ) ;
47834783
47844784 let four_removes = get_htlc_update_msgs ! ( nodes[ 4 ] , node_d_id) ;
@@ -4797,7 +4797,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
47974797 HTLCHandlingFailureType :: Receive { payment_hash: hash_2 } ,
47984798 HTLCHandlingFailureType :: Receive { payment_hash: hash_4 } ,
47994799 ] ;
4800- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 5 ] , failed_destinations_2) ;
4800+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 5 ] , failed_destinations_2) ;
48014801 check_added_monitors ( & nodes[ 5 ] , 1 ) ;
48024802
48034803 let two_removes = get_htlc_update_msgs ! ( nodes[ 5 ] , node_d_id) ;
@@ -4816,7 +4816,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
48164816 HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
48174817 HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
48184818 ] ;
4819- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations_3) ;
4819+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations_3) ;
48204820 check_added_monitors ( & nodes[ 3 ] , 1 ) ;
48214821 let six_removes = get_htlc_update_msgs ! ( nodes[ 3 ] , node_c_id) ;
48224822 nodes[ 2 ] . node . handle_update_fail_htlc ( node_d_id, & six_removes. update_fail_htlcs [ 0 ] ) ;
@@ -4896,7 +4896,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
48964896 . collect ( )
48974897 } ;
48984898
4899- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 2 ] , expected_destinations) ;
4899+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 2 ] , expected_destinations) ;
49004900 }
49014901 check_added_monitors ( & nodes[ 2 ] , 3 ) ;
49024902
@@ -5377,7 +5377,7 @@ fn do_htlc_claim_previous_remote_commitment_only(use_dust: bool, check_revoke_no
53775377 let htlc_value = if use_dust { 50000 } else { 3000000 } ;
53785378 let ( _, our_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , htlc_value) ;
53795379 nodes[ 1 ] . node . fail_htlc_backwards ( & our_payment_hash) ;
5380- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
5380+ process_htlcs_and_expect_htlc_handling_failed ! (
53815381 nodes[ 1 ] ,
53825382 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
53835383 ) ;
@@ -6014,7 +6014,7 @@ pub fn test_update_fulfill_htlc_bolt2_after_malformed_htlc_message_must_forward_
60146014
60156015 check_added_monitors ( & nodes[ 1 ] , 0 ) ;
60166016 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , update_msg. 1 , false , true ) ;
6017- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6017+ process_htlcs_and_expect_htlc_handling_failed ! (
60186018 nodes[ 1 ] ,
60196019 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
60206020 ) ;
@@ -6106,7 +6106,7 @@ pub fn test_channel_failed_after_message_with_badonion_node_perm_bits_set() {
61066106 _ => panic ! ( "Unexpected event" ) ,
61076107 }
61086108
6109- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6109+ process_htlcs_and_expect_htlc_handling_failed ! (
61106110 nodes[ 1 ] ,
61116111 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
61126112 ) ;
@@ -6188,7 +6188,7 @@ fn do_test_failure_delay_dust_htlc_local_commitment(announce_latest: bool) {
61886188 // Fail one HTLC to prune it in the will-be-latest-local commitment tx
61896189 nodes[ 1 ] . node . fail_htlc_backwards ( & payment_hash_2) ;
61906190 check_added_monitors ( & nodes[ 1 ] , 0 ) ;
6191- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6191+ process_htlcs_and_expect_htlc_handling_failed ! (
61926192 nodes[ 1 ] ,
61936193 [ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash_2 } ]
61946194 ) ;
@@ -6554,7 +6554,7 @@ pub fn test_check_htlc_underpaying() {
65546554 // Note that we first have to wait a random delay before processing the receipt of the HTLC,
65556555 // and then will wait a second random delay before failing the HTLC back:
65566556 nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
6557- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6557+ process_htlcs_and_expect_htlc_handling_failed ! (
65586558 nodes[ 1 ] ,
65596559 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
65606560 ) ;
@@ -7986,7 +7986,7 @@ pub fn test_bad_secret_hash() {
79867986 // We have to forward pending HTLCs once to process the receipt of the HTLC and then
79877987 // again to process the pending backwards-failure of the HTLC
79887988 nodes[ 1 ] . node. process_pending_htlc_forwards( ) ;
7989- expect_pending_htlcs_forwardable_and_htlc_handling_failed !(
7989+ process_htlcs_and_expect_htlc_handling_failed !(
79907990 nodes[ 1 ] ,
79917991 vec![ HTLCHandlingFailureType :: Receive { payment_hash: $payment_hash } ]
79927992 ) ;
@@ -9404,7 +9404,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
94049404 & [ ( 0 , htlc_tx) ] ,
94059405 conf_height + 1 ,
94069406 ) ;
9407- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9407+ process_htlcs_and_expect_htlc_handling_failed ! (
94089408 nodes[ 1 ] ,
94099409 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
94109410 ) ;
@@ -9434,7 +9434,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
94349434 // When the HTLC times out on the A<->B edge, the B<->C channel will fail the HTLC back to
94359435 // avoid the A<->B channel closing (even though it already has). This will generate a
94369436 // spurious HTLCHandlingFailed event.
9437- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9437+ process_htlcs_and_expect_htlc_handling_failed ! (
94389438 nodes[ 1 ] ,
94399439 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
94409440 ) ;
@@ -9687,7 +9687,7 @@ pub fn test_inconsistent_mpp_params() {
96879687 nodes[ 2 ] . node . handle_update_fail_htlc ( node_d_id, & fail_updates_1. update_fail_htlcs [ 0 ] ) ;
96889688 commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 3 ] , fail_updates_1. commitment_signed, false ) ;
96899689
9690- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9690+ process_htlcs_and_expect_htlc_handling_failed ! (
96919691 nodes[ 2 ] ,
96929692 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_d_id) , channel_id: chan_2_3. 2 } ]
96939693 ) ;
@@ -9762,7 +9762,7 @@ pub fn test_double_partial_claim() {
97629762 HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
97639763 HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
97649764 ] ;
9765- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations) ;
9765+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 3 ] , failed_destinations) ;
97669766
97679767 let reason = PaymentFailureReason :: RecipientRejected ;
97689768 pass_failed_payment_back ( & nodes[ 0 ] , paths, false , hash, reason) ;
@@ -10747,7 +10747,7 @@ fn do_payment_with_custom_min_final_cltv_expiry(valid_delta: bool, use_user_hash
1074710747 claim_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_preimage) ;
1074810748 } else {
1074910749 let fail_type = HTLCHandlingFailureType :: Receive { payment_hash : hash } ;
10750- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
10750+ process_htlcs_and_expect_htlc_handling_failed ! ( nodes[ 1 ] , [ fail_type] ) ;
1075110751
1075210752 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1075310753
0 commit comments