@@ -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 ) ;
@@ -2102,7 +2102,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
21022102 check_spends ! ( commitment_tx[ 0 ] , chan_2. 3 ) ;
21032103 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
21042104 check_added_monitors ( & nodes[ 2 ] , 0 ) ;
2105- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2105+ process_htlcs_and_expect_htlc_handling_failed ! (
21062106 nodes[ 2 ] ,
21072107 [ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash. clone( ) } ]
21082108 ) ;
@@ -2179,7 +2179,7 @@ fn do_test_htlc_on_chain_timeout(connect_style: ConnectStyle) {
21792179
21802180 connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
21812181
2182- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2182+ process_htlcs_and_expect_htlc_handling_failed ! (
21832183 nodes[ 1 ] ,
21842184 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
21852185 ) ;
@@ -2267,7 +2267,7 @@ pub fn test_simple_commitment_revoked_fail_backward() {
22672267 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
22682268 check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
22692269
2270- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
2270+ process_htlcs_and_expect_htlc_handling_failed ! (
22712271 nodes[ 1 ] ,
22722272 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
22732273 ) ;
@@ -2360,7 +2360,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23602360 let ( _, third_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , value) ;
23612361
23622362 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 ! (
23642364 nodes[ 2 ] ,
23652365 [ HTLCHandlingFailureType :: Receive { payment_hash: first_payment_hash } ]
23662366 ) ;
@@ -2377,7 +2377,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23772377 // Drop the last RAA from 3 -> 2
23782378
23792379 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 ! (
23812381 nodes[ 2 ] ,
23822382 [ HTLCHandlingFailureType :: Receive { payment_hash: second_payment_hash } ]
23832383 ) ;
@@ -2397,7 +2397,7 @@ fn do_test_commitment_revoked_fail_backward_exhaustive(
23972397 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
23982398
23992399 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 ! (
24012401 nodes[ 2 ] ,
24022402 [ HTLCHandlingFailureType :: Receive { payment_hash: third_payment_hash } ]
24032403 ) ;
@@ -3706,7 +3706,7 @@ fn do_test_htlc_timeout(send_partial_mpp: bool) {
37063706 connect_block ( & nodes[ 1 ] , & block) ;
37073707 }
37083708
3709- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
3709+ process_htlcs_and_expect_htlc_handling_failed ! (
37103710 nodes[ 1 ] ,
37113711 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
37123712 ) ;
@@ -3787,7 +3787,7 @@ fn do_test_holding_cell_htlc_add_timeouts(forwarded_htlc: bool) {
37873787 if forwarded_htlc {
37883788 let fail_type =
37893789 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] ) ;
37913791 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
37923792 let fail_commit = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
37933793 assert_eq ! ( fail_commit. len( ) , 1 ) ;
@@ -4570,7 +4570,7 @@ pub fn test_duplicate_payment_hash_one_failure_one_success() {
45704570 // Mine the HTLC timeout transaction on node B.
45714571 mine_transaction ( & nodes[ 1 ] , & htlc_timeout_tx) ;
45724572 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 ! (
45744574 nodes[ 1 ] ,
45754575 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
45764576 ) ;
@@ -4793,7 +4793,7 @@ fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, anno
47934793 HTLCHandlingFailureType :: Receive { payment_hash: hash_5 } ,
47944794 HTLCHandlingFailureType :: Receive { payment_hash: hash_6 } ,
47954795 ] ;
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) ;
47974797 check_added_monitors ( & nodes[ 4 ] , 1 ) ;
47984798
47994799 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
48124812 HTLCHandlingFailureType :: Receive { payment_hash: hash_2 } ,
48134813 HTLCHandlingFailureType :: Receive { payment_hash: hash_4 } ,
48144814 ] ;
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) ;
48164816 check_added_monitors ( & nodes[ 5 ] , 1 ) ;
48174817
48184818 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
48314831 HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
48324832 HTLCHandlingFailureType :: Forward { node_id: Some ( node_f_id) , channel_id: chan_3_5. 2 } ,
48334833 ] ;
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) ;
48354835 check_added_monitors ( & nodes[ 3 ] , 1 ) ;
48364836 let six_removes = get_htlc_update_msgs ! ( nodes[ 3 ] , node_c_id) ;
48374837 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
49114911 . collect ( )
49124912 } ;
49134913
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) ;
49154915 }
49164916 check_added_monitors ( & nodes[ 2 ] , 3 ) ;
49174917
@@ -5392,7 +5392,7 @@ fn do_htlc_claim_previous_remote_commitment_only(use_dust: bool, check_revoke_no
53925392 let htlc_value = if use_dust { 50000 } else { 3000000 } ;
53935393 let ( _, our_payment_hash, ..) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , htlc_value) ;
53945394 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 ! (
53965396 nodes[ 1 ] ,
53975397 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
53985398 ) ;
@@ -6029,7 +6029,7 @@ pub fn test_update_fulfill_htlc_bolt2_after_malformed_htlc_message_must_forward_
60296029
60306030 check_added_monitors ( & nodes[ 1 ] , 0 ) ;
60316031 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 ! (
60336033 nodes[ 1 ] ,
60346034 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
60356035 ) ;
@@ -6121,7 +6121,7 @@ pub fn test_channel_failed_after_message_with_badonion_node_perm_bits_set() {
61216121 _ => panic ! ( "Unexpected event" ) ,
61226122 }
61236123
6124- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6124+ process_htlcs_and_expect_htlc_handling_failed ! (
61256125 nodes[ 1 ] ,
61266126 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id: chan_2. 2 } ]
61276127 ) ;
@@ -6203,7 +6203,7 @@ fn do_test_failure_delay_dust_htlc_local_commitment(announce_latest: bool) {
62036203 // Fail one HTLC to prune it in the will-be-latest-local commitment tx
62046204 nodes[ 1 ] . node . fail_htlc_backwards ( & payment_hash_2) ;
62056205 check_added_monitors ( & nodes[ 1 ] , 0 ) ;
6206- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6206+ process_htlcs_and_expect_htlc_handling_failed ! (
62076207 nodes[ 1 ] ,
62086208 [ HTLCHandlingFailureType :: Receive { payment_hash: payment_hash_2 } ]
62096209 ) ;
@@ -6569,7 +6569,7 @@ pub fn test_check_htlc_underpaying() {
65696569 // Note that we first have to wait a random delay before processing the receipt of the HTLC,
65706570 // and then will wait a second random delay before failing the HTLC back:
65716571 nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
6572- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
6572+ process_htlcs_and_expect_htlc_handling_failed ! (
65736573 nodes[ 1 ] ,
65746574 [ HTLCHandlingFailureType :: Receive { payment_hash: our_payment_hash } ]
65756575 ) ;
@@ -8001,7 +8001,7 @@ pub fn test_bad_secret_hash() {
80018001 // We have to forward pending HTLCs once to process the receipt of the HTLC and then
80028002 // again to process the pending backwards-failure of the HTLC
80038003 nodes[ 1 ] . node. process_pending_htlc_forwards( ) ;
8004- expect_pending_htlcs_forwardable_and_htlc_handling_failed !(
8004+ process_htlcs_and_expect_htlc_handling_failed !(
80058005 nodes[ 1 ] ,
80068006 vec![ HTLCHandlingFailureType :: Receive { payment_hash: $payment_hash } ]
80078007 ) ;
@@ -9416,7 +9416,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
94169416 & [ ( 0 , htlc_tx) ] ,
94179417 conf_height + 1 ,
94189418 ) ;
9419- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9419+ process_htlcs_and_expect_htlc_handling_failed ! (
94209420 nodes[ 1 ] ,
94219421 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
94229422 ) ;
@@ -9446,7 +9446,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
94469446 // When the HTLC times out on the A<->B edge, the B<->C channel will fail the HTLC back to
94479447 // avoid the A<->B channel closing (even though it already has). This will generate a
94489448 // spurious HTLCHandlingFailed event.
9449- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9449+ process_htlcs_and_expect_htlc_handling_failed ! (
94509450 nodes[ 1 ] ,
94519451 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_c_id) , channel_id } ]
94529452 ) ;
@@ -9699,7 +9699,7 @@ pub fn test_inconsistent_mpp_params() {
96999699 nodes[ 2 ] . node . handle_update_fail_htlc ( node_d_id, & fail_updates_1. update_fail_htlcs [ 0 ] ) ;
97009700 commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 3 ] , fail_updates_1. commitment_signed, false ) ;
97019701
9702- expect_pending_htlcs_forwardable_and_htlc_handling_failed ! (
9702+ process_htlcs_and_expect_htlc_handling_failed ! (
97039703 nodes[ 2 ] ,
97049704 [ HTLCHandlingFailureType :: Forward { node_id: Some ( node_d_id) , channel_id: chan_2_3. 2 } ]
97059705 ) ;
@@ -9774,7 +9774,7 @@ pub fn test_double_partial_claim() {
97749774 HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
97759775 HTLCHandlingFailureType :: Receive { payment_hash: hash } ,
97769776 ] ;
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) ;
97789778
97799779 let reason = PaymentFailureReason :: RecipientRejected ;
97809780 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
1075910759 claim_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_preimage) ;
1076010760 } else {
1076110761 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] ) ;
1076310763
1076410764 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1076510765
0 commit comments