@@ -15,7 +15,7 @@ use bitcoin::secp256k1::ecdsa::{RecoverableSignature, Signature};
15
15
use crate :: blinded_path;
16
16
use crate :: blinded_path:: payment:: { BlindedPaymentPath , Bolt12RefundContext , ForwardTlvs , PaymentConstraints , PaymentContext , PaymentForwardNode , PaymentRelay , UnauthenticatedReceiveTlvs , PAYMENT_PADDING_ROUND_OFF } ;
17
17
use crate :: blinded_path:: utils:: is_padded;
18
- use crate :: events:: { Event , HTLCDestination , PaymentFailureReason } ;
18
+ use crate :: events:: { Event , HTLCHandlingType , PaymentFailureReason } ;
19
19
use crate :: ln:: types:: ChannelId ;
20
20
use crate :: types:: payment:: { PaymentHash , PaymentSecret } ;
21
21
use crate :: ln:: channelmanager;
@@ -425,10 +425,10 @@ fn do_forward_checks_failure(check: ForwardCheckFail, intro_fails: bool) {
425
425
nodes[ 0 ] . node . handle_update_fail_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & updates. update_fail_htlcs [ 0 ] ) ;
426
426
do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & updates. commitment_signed , false , false ) ;
427
427
let failed_destination = match check {
428
- ForwardCheckFail :: InboundOnionCheck => HTLCDestination :: InvalidOnion ,
429
- ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCDestination :: InvalidOnion ,
428
+ ForwardCheckFail :: InboundOnionCheck => HTLCHandlingType :: InvalidOnion ,
429
+ ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCHandlingType :: InvalidOnion ,
430
430
ForwardCheckFail :: OutboundChannelCheck =>
431
- HTLCDestination :: NextHopChannel { node_id : Some ( nodes[ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_1_2. 2 } ,
431
+ HTLCHandlingType :: NextHopChannel { node_id : Some ( nodes[ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_1_2. 2 } ,
432
432
} ;
433
433
expect_htlc_handling_failed_destinations ! (
434
434
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) {
457
457
458
458
expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
459
459
let failed_destination = match check {
460
- ForwardCheckFail :: InboundOnionCheck |ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCDestination :: InvalidOnion ,
460
+ ForwardCheckFail :: InboundOnionCheck |ForwardCheckFail :: ForwardPayloadEncodedAsReceive => HTLCHandlingType :: InvalidOnion ,
461
461
ForwardCheckFail :: OutboundChannelCheck =>
462
- HTLCDestination :: NextHopChannel { node_id : Some ( nodes[ 3 ] . node . get_our_node_id ( ) ) , channel_id : chan_2_3. 2 } ,
462
+ HTLCHandlingType :: NextHopChannel { node_id : Some ( nodes[ 3 ] . node . get_our_node_id ( ) ) , channel_id : chan_2_3. 2 } ,
463
463
} ;
464
464
expect_htlc_handling_failed_destinations ! (
465
465
nodes[ 2 ] . node. get_and_clear_pending_events( ) , & [ failed_destination. clone( ) ]
@@ -527,7 +527,7 @@ fn failed_backwards_to_intro_node() {
527
527
do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event. commitment_msg , true , true ) ;
528
528
529
529
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( ) , & [ HTLCHandlingType :: InvalidOnion ] ) ;
531
531
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
532
532
533
533
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,
606
606
$curr_node. node. peer_disconnected( $next_node. node. get_our_node_id( ) ) ;
607
607
expect_pending_htlcs_forwardable!( $curr_node) ;
608
608
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![ HTLCHandlingType :: NextHopChannel { node_id: Some ( $next_node. node. get_our_node_id( ) ) , channel_id: $failed_chan_id } ] ) ;
610
610
} ,
611
611
ProcessPendingHTLCsCheck :: FwdChannelClosed => {
612
612
// 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,
626
626
627
627
$curr_node. node. process_pending_htlc_forwards( ) ;
628
628
expect_htlc_handling_failed_destinations!( $curr_node. node. get_and_clear_pending_events( ) ,
629
- vec![ HTLCDestination :: UnknownNextHop { requested_forward_scid: $failed_scid } ] ) ;
629
+ vec![ HTLCHandlingType :: UnknownNextHop { requested_forward_scid: $failed_scid } ] ) ;
630
630
$curr_node. node. process_pending_htlc_forwards( ) ;
631
631
} ,
632
632
}
@@ -725,7 +725,7 @@ fn do_blinded_intercept_payment(intercept_node_fails: bool) {
725
725
726
726
if intercept_node_fails {
727
727
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![ HTLCHandlingType :: UnknownNextHop { requested_forward_scid: intercept_scid } ] ) ;
729
729
nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
730
730
check_added_monitors ! ( & nodes[ 1 ] , 1 ) ;
731
731
fail_blinded_htlc_backwards ( payment_hash, 1 , & [ & nodes[ 0 ] , & nodes[ 1 ] ] , false ) ;
@@ -830,7 +830,7 @@ fn three_hop_blinded_path_fail() {
830
830
831
831
nodes[ 3 ] . node . fail_htlc_backwards ( & payment_hash) ;
832
832
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 ( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ]
834
834
) ;
835
835
nodes[ 3 ] . node . process_pending_htlc_forwards ( ) ;
836
836
check_added_monitors ! ( nodes[ 3 ] , 1 ) ;
@@ -958,7 +958,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
958
958
) ;
959
959
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
960
960
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 ( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ]
962
962
) ;
963
963
nodes[ 2 ] . node . process_pending_htlc_forwards ( ) ;
964
964
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
@@ -988,7 +988,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
988
988
check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
989
989
do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
990
990
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( ) , & [ HTLCHandlingType :: InvalidOnion ] ) ;
992
992
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
993
993
} ,
994
994
ReceiveCheckFail :: ReceiveRequirements => {
@@ -998,7 +998,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
998
998
check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
999
999
do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1000
1000
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( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ] ) ;
1002
1002
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
1003
1003
} ,
1004
1004
ReceiveCheckFail :: ChannelCheck => {
@@ -1014,7 +1014,7 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
1014
1014
nodes[ 2 ] . node . handle_shutdown ( nodes[ 1 ] . node . get_our_node_id ( ) , & node_1_shutdown) ;
1015
1015
commitment_signed_dance ! ( nodes[ 2 ] , nodes[ 1 ] , ( ) , false , true , false , false ) ;
1016
1016
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( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ] ) ;
1018
1018
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
1019
1019
} ,
1020
1020
ReceiveCheckFail :: ProcessPendingHTLCsCheck => {
@@ -1024,15 +1024,15 @@ fn do_multi_hop_receiver_fail(check: ReceiveCheckFail) {
1024
1024
do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1025
1025
expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1026
1026
expect_pending_htlcs_forwardable_and_htlc_handling_failed_ignore ! ( nodes[ 2 ] ,
1027
- vec![ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
1027
+ vec![ HTLCHandlingType :: FailedPayment { payment_hash } ] ) ;
1028
1028
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1029
1029
} ,
1030
1030
ReceiveCheckFail :: PaymentConstraints => {
1031
1031
nodes[ 2 ] . node . handle_update_add_htlc ( nodes[ 1 ] . node . get_our_node_id ( ) , & payment_event_1_2. msgs [ 0 ] ) ;
1032
1032
check_added_monitors ! ( nodes[ 2 ] , 0 ) ;
1033
1033
do_commitment_signed_dance ( & nodes[ 2 ] , & nodes[ 1 ] , & payment_event_1_2. commitment_msg , true , true ) ;
1034
1034
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( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ] ) ;
1036
1036
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
1037
1037
}
1038
1038
}
@@ -1121,7 +1121,7 @@ fn blinded_path_retries() {
1121
1121
( $intro_node: expr) => {
1122
1122
nodes[ 3 ] . node. fail_htlc_backwards( & payment_hash) ;
1123
1123
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( ) , & [ HTLCHandlingType :: FailedPayment { payment_hash } ]
1125
1125
) ;
1126
1126
nodes[ 3 ] . node. process_pending_htlc_forwards( ) ;
1127
1127
check_added_monitors!( nodes[ 3 ] , 1 ) ;
@@ -1243,7 +1243,7 @@ fn min_htlc() {
1243
1243
expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
1244
1244
expect_htlc_handling_failed_destinations ! (
1245
1245
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
+ & [ HTLCHandlingType :: NextHopChannel { node_id: Some ( nodes[ 2 ] . node. get_our_node_id( ) ) , channel_id: chan_1_2. 2 } ]
1247
1247
) ;
1248
1248
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
1249
1249
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() {
1436
1436
expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
1437
1437
nodes[ 1 ] . node . process_pending_htlc_forwards ( ) ;
1438
1438
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( ) , & [ HTLCHandlingType :: InvalidOnion ] ) ;
1440
1440
1441
1441
let mut update_fail = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
1442
1442
assert ! ( update_fail. update_fail_htlcs. len( ) == 1 ) ;
@@ -2141,7 +2141,7 @@ fn do_test_trampoline_single_hop_receive(success: bool) {
2141
2141
let args = PassAlongPathArgs :: new ( & nodes[ 0 ] , route, amt_msat, payment_hash, first_message_event)
2142
2142
. with_payment_preimage ( payment_preimage)
2143
2143
. without_claimable_event ( )
2144
- . expect_failure ( HTLCDestination :: InvalidOnion ) ;
2144
+ . expect_failure ( HTLCHandlingType :: InvalidOnion ) ;
2145
2145
do_pass_along_path ( args) ;
2146
2146
2147
2147
{
@@ -2435,7 +2435,7 @@ fn test_trampoline_forward_rejection() {
2435
2435
let args = PassAlongPathArgs :: new ( & nodes[ 0 ] , route, amt_msat, payment_hash, first_message_event)
2436
2436
. with_payment_preimage ( payment_preimage)
2437
2437
. without_claimable_event ( )
2438
- . expect_failure ( HTLCDestination :: FailedPayment { payment_hash } ) ;
2438
+ . expect_failure ( HTLCHandlingType :: FailedPayment { payment_hash } ) ;
2439
2439
do_pass_along_path ( args) ;
2440
2440
2441
2441
{
0 commit comments