@@ -439,7 +439,7 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
439439 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
440440 do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & updates_0_1. commitment_signed , true , true ) ;
441441
442- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
442+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
443443 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
444444
445445 if intro_fails {
@@ -477,7 +477,7 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
477477 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
478478 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & updates_1_2. commitment_signed , true , true ) ;
479479
480- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
480+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
481481 let failed_destination = match check {
482482 ForwardCheckFail :: InboundOnionCheck |ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCHandlingFailureType :: InvalidOnion ,
483483 ForwardCheckFail :: OutboundChannelCheck =>
@@ -534,7 +534,7 @@ fn failed_backwards_to_intro_node() {
534534 nodes[ 1 ] . node . handle_update_add_htlc ( nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
535535 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
536536 do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & payment_event. commitment_msg , false , false ) ;
537- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
537+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
538538 check_added_monitors ! ( & nodes[ 1 ] , 1 ) ;
539539
540540 let mut events = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
@@ -548,7 +548,7 @@ fn failed_backwards_to_intro_node() {
548548 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
549549 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event. commitment_msg , true , true ) ;
550550
551- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
551+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
552552 expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
553553 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
554554
@@ -626,7 +626,7 @@ fn do_forward_fail_in_process_pending_htlc_fwds(check: ProcessPendingHTLCsCheck,
626626 // Disconnect the next-hop peer so when we go to forward in process_pending_htlc_forwards, the
627627 // intro node will error backwards.
628628 $curr_node. node. peer_disconnected( $next_node. node. get_our_node_id( ) ) ;
629- expect_pending_htlcs_forwardable! ( $curr_node) ;
629+ expect_pending_htlc_processing ( & $curr_node, false ) ;
630630 expect_htlc_handling_failed_destinations!( $curr_node. node. get_and_clear_pending_events( ) ,
631631 vec![ HTLCHandlingFailureType :: Forward { node_id: Some ( $next_node. node. get_our_node_id( ) ) , channel_id: $failed_chan_id } ] ) ;
632632 } ,
@@ -645,7 +645,6 @@ fn do_forward_fail_in_process_pending_htlc_fwds(check: ProcessPendingHTLCsCheck,
645645 $curr_node. node. process_pending_htlc_forwards( ) ;
646646 expect_htlc_handling_failed_destinations!( $curr_node. node. get_and_clear_pending_events( ) ,
647647 vec![ HTLCHandlingFailureType :: InvalidForward { requested_forward_scid: $failed_scid } ] ) ;
648- $curr_node. node. process_pending_htlc_forwards( ) ;
649648 } ,
650649 }
651650 }
@@ -658,7 +657,7 @@ fn do_forward_fail_in_process_pending_htlc_fwds(check: ProcessPendingHTLCsCheck,
658657 return
659658 }
660659
661- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
660+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
662661 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
663662
664663 let mut updates_1_2 = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 2 ] . node. get_our_node_id( ) ) ;
@@ -725,7 +724,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
725724 } ;
726725 nodes[ 1 ] . node . handle_update_add_htlc ( nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
727726 commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , & payment_event. commitment_msg, false , true ) ;
728- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
727+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
729728
730729 let events = nodes[ 1 ] . node . get_and_clear_pending_events ( ) ;
731730 assert_eq ! ( events. len( ) , 1 ) ;
@@ -751,7 +750,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
751750 }
752751
753752 nodes[ 1 ] . node . forward_intercepted_htlc ( intercept_id, & channel_id, nodes[ 2 ] . node . get_our_node_id ( ) , expected_outbound_amount_msat) . unwrap ( ) ;
754- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
753+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
755754
756755 let payment_event = {
757756 {
@@ -765,7 +764,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
765764 } ;
766765 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
767766 commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 1 ] , & payment_event. commitment_msg, false , true ) ;
768- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
767+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
769768
770769 expect_payment_claimable ! ( & nodes[ 2 ] , payment_hash, payment_secret, amt_msat, None , nodes[ 2 ] . node. get_our_node_id( ) ) ;
771770 do_claim_payment_along_route (
@@ -954,7 +953,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
954953 nodes[ 1 ] . node . handle_update_add_htlc ( nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event_0_1. msgs [ 0 ] ) ;
955954 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
956955 do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & payment_event_0_1. commitment_msg , false , false ) ;
957- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
956+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
958957 check_added_monitors ! ( & nodes[ 1 ] , 1 ) ;
959958
960959 let mut payment_event_1_2 = {
@@ -969,7 +968,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
969968 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event_1_2. msgs [ 0 ] ) ;
970969 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
971970 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
972- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
971+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
973972 check_payment_claimable (
974973 & nodes[ 2 ] . node . get_and_clear_pending_events ( ) [ 0 ] , payment_hash, payment_secret, amt_msat,
975974 None , nodes[ 2 ] . node . get_our_node_id ( )
@@ -1005,7 +1004,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10051004 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , update_add) ;
10061005 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
10071006 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1008- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1007+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
10091008 expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
10101009 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10111010 } ,
@@ -1015,7 +1014,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10151014 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , update_add) ;
10161015 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
10171016 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1018- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1017+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
10191018 expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: Receive { payment_hash } ] ) ;
10201019 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10211020 } ,
@@ -1031,7 +1030,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10311030
10321031 nodes[ 2 ] . node . handle_shutdown ( nodes[ 1 ] . node . get_our_node_id ( ) , & node_1_shutdown) ;
10331032 commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 1 ] , ( ) , false , true , false , false ) ;
1034- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1033+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
10351034 expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: Receive { payment_hash } ] ) ;
10361035 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10371036 } ,
@@ -1040,7 +1039,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10401039 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event_1_2. msgs [ 0 ] ) ;
10411040 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
10421041 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1043- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1042+ expect_pending_htlc_processing ( & nodes[ 2 ] , true ) ;
10441043 expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore ! ( nodes[ 2 ] ,
10451044 [ HTLCHandlingFailureType :: Receive { payment_hash } ] ) ;
10461045 check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
@@ -1049,7 +1048,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10491048 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event_1_2. msgs [ 0 ] ) ;
10501049 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
10511050 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1052- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1051+ expect_pending_htlc_processing ( & nodes[ 2 ] , false ) ;
10531052 expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: Receive { payment_hash } ] ) ;
10541053 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10551054 }
@@ -1254,7 +1253,7 @@ fn min_htlc() {
12541253 nodes[ 1 ] . node . handle_update_add_htlc ( nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event_0_1. msgs [ 0 ] ) ;
12551254 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
12561255 do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & payment_event_0_1. commitment_msg , true , true ) ;
1257- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
1256+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
12581257 expect_htlc_handling_failed_destinations ! (
12591258 nodes[ 1 ] . node. get_and_clear_pending_events( ) ,
12601259 & [ HTLCHandlingFailureType :: Forward { node_id: Some ( nodes[ 2 ] . node. get_our_node_id( ) ) , channel_id: chan_1_2. 2 } ]
@@ -1447,7 +1446,7 @@ fn fails_receive_tlvs_authentication() {
14471446
14481447 nodes[ 1 ] . node . handle_update_add_htlc ( nodes[ 0 ] . node . get_our_node_id ( ) , & payment_event. msgs [ 0 ] ) ;
14491448 do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & payment_event. commitment_msg , true , true ) ;
1450- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
1449+ expect_pending_htlc_processing ( & nodes[ 1 ] , false ) ;
14511450 nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
14521451 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
14531452 expect_htlc_handling_failed_destinations ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
0 commit comments