@@ -15,7 +15,7 @@ use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
1515use crate :: blinded_path;
1616use crate :: blinded_path:: payment:: { BlindedPaymentPath , Bolt12RefundContext , ForwardTlvs , PaymentConstraints , PaymentContext , PaymentForwardNode , PaymentRelay , UnauthenticatedReceiveTlvs , PAYMENT_PADDING_ROUND_OFF } ;
1717use crate :: blinded_path:: utils:: is_padded;
18- use crate :: events:: { Event , HTLCDestination , PaymentFailureReason } ;
18+ use crate :: events:: { Event , HTLCHandlingFailureType , PaymentFailureReason } ;
1919use crate :: ln:: types:: ChannelId ;
2020use crate :: types:: payment:: { PaymentHash , PaymentSecret } ;
2121use crate :: ln:: channelmanager;
@@ -425,10 +425,10 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
425425 nodes[ 0 ] . node . handle_update_fail_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & updates. update_fail_htlcs [ 0 ] ) ;
426426 do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & updates. commitment_signed , false , false ) ;
427427 let failed_destination = match check {
428- ForwardCheckFail :: InboundOnionCheck => HTLCDestination :: InvalidOnion ,
429- ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCDestination :: InvalidOnion ,
428+ ForwardCheckFail :: InboundOnionCheck => HTLCHandlingFailureType :: InvalidOnion ,
429+ ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCHandlingFailureType :: InvalidOnion ,
430430 ForwardCheckFail :: OutboundChannelCheck =>
431- HTLCDestination :: NextHopChannel { node_id : Some ( nodes[ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_1_2. 2 } ,
431+ HTLCHandlingFailureType :: NextHopChannel { node_id : Some ( nodes[ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_1_2. 2 } ,
432432 } ;
433433 expect_htlc_handling_failed_destinations ! (
434434 nodes[ 1 ] . node. get_and_clear_pending_events( ) , & [ failed_destination. clone( ) ]
@@ -457,9 +457,9 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
457457
458458 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
459459 let failed_destination = match check {
460- ForwardCheckFail :: InboundOnionCheck |ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCDestination :: InvalidOnion ,
460+ ForwardCheckFail :: InboundOnionCheck |ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCHandlingFailureType :: InvalidOnion ,
461461 ForwardCheckFail :: OutboundChannelCheck =>
462- HTLCDestination :: NextHopChannel { node_id : Some ( nodes[ 3 ] . node . get_our_node_id ( ) ) , channel_id : chan_2_3. 2 } ,
462+ HTLCHandlingFailureType :: NextHopChannel { node_id : Some ( nodes[ 3 ] . node . get_our_node_id ( ) ) , channel_id : chan_2_3. 2 } ,
463463 } ;
464464 expect_htlc_handling_failed_destinations ! (
465465 nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ failed_destination. clone( ) ]
@@ -527,7 +527,7 @@ fn failed_backwards_to_intro_node() {
527527 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event. commitment_msg , true , true ) ;
528528
529529 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
530- expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: InvalidOnion ] ) ;
530+ expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
531531 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
532532
533533 let mut updates = get_htlc_update_msgs ! ( nodes[ 2 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
@@ -606,7 +606,7 @@ fn do_forward_fail_in_process_pending_htlc_fwds(check: ProcessPendingHTLCsCheck,
606606 $curr_node. node. peer_disconnected( $next_node. node. get_our_node_id( ) ) ;
607607 expect_pending_htlcs_forwardable!( $curr_node) ;
608608 expect_htlc_handling_failed_destinations!( $curr_node. node. get_and_clear_pending_events( ) ,
609- vec![ HTLCDestination :: NextHopChannel { node_id: Some ( $next_node. node. get_our_node_id( ) ) , channel_id: $failed_chan_id } ] ) ;
609+ vec![ HTLCHandlingFailureType :: NextHopChannel { node_id: Some ( $next_node. node. get_our_node_id( ) ) , channel_id: $failed_chan_id } ] ) ;
610610 } ,
611611 ProcessPendingHTLCsCheck :: FwdChannelClosed => {
612612 // Force close the next-hop channel so when we go to forward in process_pending_htlc_forwards,
@@ -626,7 +626,7 @@ fn do_forward_fail_in_process_pending_htlc_fwds(check: ProcessPendingHTLCsCheck,
626626
627627 $curr_node. node. process_pending_htlc_forwards( ) ;
628628 expect_htlc_handling_failed_destinations!( $curr_node. node. get_and_clear_pending_events( ) ,
629- vec![ HTLCDestination :: UnknownNextHop { requested_forward_scid: $failed_scid } ] ) ;
629+ vec![ HTLCHandlingFailureType :: UnknownNextHop { requested_forward_scid: $failed_scid } ] ) ;
630630 $curr_node. node. process_pending_htlc_forwards( ) ;
631631 } ,
632632 }
@@ -725,7 +725,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
725725
726726 if intercept_node_fails {
727727 nodes[ 1 ] . node . fail_intercepted_htlc ( intercept_id) . unwrap ( ) ;
728- expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore ! ( nodes[ 1 ] , vec![ HTLCDestination :: UnknownNextHop { requested_forward_scid: intercept_scid } ] ) ;
728+ expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore ! ( nodes[ 1 ] , vec![ HTLCHandlingFailureType :: UnknownNextHop { requested_forward_scid: intercept_scid } ] ) ;
729729 nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
730730 check_added_monitors ! ( & nodes[ 1 ] , 1 ) ;
731731 fail_blinded_htlc_backwards ( payment_hash, 1 , & [ & nodes[ 0 ] , & nodes[ 1 ] ] , false ) ;
@@ -830,7 +830,7 @@ fn three_hop_blinded_path_fail() {
830830
831831 nodes[ 3 ] . node . fail_htlc_backwards ( & payment_hash) ;
832832 expect_pending_htlcs_forwardable_conditions (
833- nodes[ 3 ] . node . get_and_clear_pending_events ( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ]
833+ nodes[ 3 ] . node . get_and_clear_pending_events ( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ]
834834 ) ;
835835 nodes[ 3 ] . node . process_pending_htlc_forwards ( ) ;
836836 check_added_monitors ! ( nodes[ 3 ] , 1 ) ;
@@ -958,7 +958,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
958958 ) ;
959959 nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
960960 expect_pending_htlcs_forwardable_conditions (
961- nodes[ 2 ] . node . get_and_clear_pending_events ( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ]
961+ nodes[ 2 ] . node . get_and_clear_pending_events ( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ]
962962 ) ;
963963 nodes[ 2 ] . node . process_pending_htlc_forwards ( ) ;
964964 check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
@@ -988,7 +988,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
988988 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
989989 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
990990 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
991- expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: InvalidOnion ] ) ;
991+ expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
992992 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
993993 } ,
994994 ReceiveCheckFail :: ReceiveRequirements => {
@@ -998,7 +998,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
998998 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
999999 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
10001000 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1001- expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
1001+ expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ] ) ;
10021002 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10031003 } ,
10041004 ReceiveCheckFail :: ChannelCheck => {
@@ -1014,7 +1014,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10141014 nodes[ 2 ] . node . handle_shutdown ( nodes[ 1 ] . node . get_our_node_id ( ) , & node_1_shutdown) ;
10151015 commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 1 ] , ( ) , false , true , false , false ) ;
10161016 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1017- expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
1017+ expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ] ) ;
10181018 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10191019 } ,
10201020 ReceiveCheckFail :: ProcessPendingHTLCsCheck => {
@@ -1024,15 +1024,15 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
10241024 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
10251025 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
10261026 expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore ! ( nodes[ 2 ] ,
1027- vec![ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
1027+ vec![ HTLCHandlingFailureType :: FailedPayment { payment_hash } ] ) ;
10281028 check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
10291029 } ,
10301030 ReceiveCheckFail :: PaymentConstraints => {
10311031 nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event_1_2. msgs [ 0 ] ) ;
10321032 check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
10331033 do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
10341034 expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1035- expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
1035+ expect_htlc_handling_failed_destinations ! ( nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ] ) ;
10361036 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
10371037 }
10381038 }
@@ -1121,7 +1121,7 @@ fn blinded_path_retries() {
11211121 ( $intro_node: expr) => {
11221122 nodes[ 3 ] . node. fail_htlc_backwards( & payment_hash) ;
11231123 expect_pending_htlcs_forwardable_conditions(
1124- nodes[ 3 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: FailedPayment { payment_hash } ]
1124+ nodes[ 3 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: FailedPayment { payment_hash } ]
11251125 ) ;
11261126 nodes[ 3 ] . node. process_pending_htlc_forwards( ) ;
11271127 check_added_monitors!( nodes[ 3 ] , 1 ) ;
@@ -1243,7 +1243,7 @@ fn min_htlc() {
12431243 expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
12441244 expect_htlc_handling_failed_destinations ! (
12451245 nodes[ 1 ] . node. get_and_clear_pending_events( ) ,
1246- & [ HTLCDestination :: NextHopChannel { node_id: Some ( nodes[ 2 ] . node. get_our_node_id( ) ) , channel_id: chan_1_2. 2 } ]
1246+ & [ HTLCHandlingFailureType :: NextHopChannel { node_id: Some ( nodes[ 2 ] . node. get_our_node_id( ) ) , channel_id: chan_1_2. 2 } ]
12471247 ) ;
12481248 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
12491249 let mut updates = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
@@ -1436,7 +1436,7 @@ fn fails_receive_tlvs_authentication() {
14361436 expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
14371437 nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
14381438 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1439- expect_htlc_handling_failed_destinations ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) , & [ HTLCDestination :: InvalidOnion ] ) ;
1439+ expect_htlc_handling_failed_destinations ! ( nodes[ 1 ] . node. get_and_clear_pending_events( ) , & [ HTLCHandlingFailureType :: InvalidOnion ] ) ;
14401440
14411441 let mut update_fail = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
14421442 assert ! ( update_fail. update_fail_htlcs. len( ) == 1 ) ;
@@ -2141,7 +2141,7 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
21412141 let args = PassAlongPathArgs :: new ( & nodes[ 0 ] , route, amt_msat, payment_hash, first_message_event)
21422142 . with_payment_preimage ( payment_preimage)
21432143 . without_claimable_event ( )
2144- . expect_failure ( HTLCDestination :: InvalidOnion ) ;
2144+ . expect_failure ( HTLCHandlingFailureType :: InvalidOnion ) ;
21452145 do_pass_along_path ( args) ;
21462146
21472147 {
@@ -2435,7 +2435,7 @@ fn test_trampoline_forward_rejection() {
24352435 let args = PassAlongPathArgs :: new ( & nodes[ 0 ] , route, amt_msat, payment_hash, first_message_event)
24362436 . with_payment_preimage ( payment_preimage)
24372437 . without_claimable_event ( )
2438- . expect_failure ( HTLCDestination :: FailedPayment { payment_hash } ) ;
2438+ . expect_failure ( HTLCHandlingFailureType :: FailedPayment { payment_hash } ) ;
24392439 do_pass_along_path ( args) ;
24402440
24412441 {
0 commit comments