@@ -26,7 +26,7 @@ use ln::msgs;
26
26
use ln:: msgs:: { ChannelMessageHandler , RoutingMessageHandler } ;
27
27
use util:: config:: UserConfig ;
28
28
use util:: enforcing_trait_impls:: EnforcingSigner ;
29
- use util:: events:: { Event , MessageSendEvent , MessageSendEventsProvider , PaymentPurpose , ClosureReason } ;
29
+ use util:: events:: { Event , MessageSendEvent , MessageSendEventsProvider , PaymentPurpose , ClosureReason , HTLCDestination } ;
30
30
use util:: errors:: APIError ;
31
31
use util:: ser:: { ReadableArgs , Writeable } ;
32
32
use util:: test_utils:: TestBroadcaster ;
@@ -832,7 +832,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
832
832
833
833
// Fail the payment backwards, failing the monitor update on nodes[1]'s receipt of the RAA
834
834
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash_1) ;
835
- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
835
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 2 ] , vec! [ HTLCDestination :: FailedPayment { payment_hash : payment_hash_1 } ] ) ;
836
836
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
837
837
838
838
let updates = get_htlc_update_msgs ! ( nodes[ 2 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
@@ -913,7 +913,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
913
913
let ( outpoint, latest_update, _) = nodes[ 1 ] . chain_monitor . latest_monitor_update_id . lock ( ) . unwrap ( ) . get ( & chan_2. 2 ) . unwrap ( ) . clone ( ) ;
914
914
nodes[ 1 ] . chain_monitor . chain_monitor . force_channel_monitor_updated ( outpoint, latest_update) ;
915
915
check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
916
- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
916
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , vec! [ HTLCDestination :: NextHopChannel { node_id : Some ( nodes [ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_2 . 2 } ] ) ;
917
917
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
918
918
919
919
let mut events_3 = nodes[ 1 ] . node . get_and_clear_pending_msg_events ( ) ;
@@ -1690,14 +1690,14 @@ fn test_monitor_update_on_pending_forwards() {
1690
1690
let node_chanmgrs = create_node_chanmgrs ( 3 , & node_cfgs, & [ None , None , None ] ) ;
1691
1691
let mut nodes = create_network ( 3 , & node_cfgs, & node_chanmgrs) ;
1692
1692
let chan_1 = create_announced_chan_between_nodes ( & nodes, 0 , 1 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
1693
- create_announced_chan_between_nodes ( & nodes, 1 , 2 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
1693
+ let chan_2 = create_announced_chan_between_nodes ( & nodes, 1 , 2 , InitFeatures :: known ( ) , InitFeatures :: known ( ) ) ;
1694
1694
1695
1695
// Rebalance a bit so that we can send backwards from 3 to 1.
1696
1696
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 5000000 ) ;
1697
1697
1698
1698
let ( _, payment_hash_1, _) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] , & nodes[ 2 ] ] , 1000000 ) ;
1699
1699
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash_1) ;
1700
- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
1700
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 2 ] , vec! [ HTLCDestination :: FailedPayment { payment_hash : payment_hash_1 } ] ) ;
1701
1701
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1702
1702
1703
1703
let cs_fail_update = get_htlc_update_msgs ! ( nodes[ 2 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
@@ -1718,7 +1718,7 @@ fn test_monitor_update_on_pending_forwards() {
1718
1718
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false ) ;
1719
1719
1720
1720
chanmon_cfgs[ 1 ] . persister . set_update_ret ( Err ( ChannelMonitorUpdateErr :: TemporaryFailure ) ) ;
1721
- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
1721
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , vec! [ HTLCDestination :: NextHopChannel { node_id : Some ( nodes [ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_2 . 2 } ] ) ;
1722
1722
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1723
1723
assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1724
1724
nodes[ 1 ] . logger . assert_log ( "lightning::ln::channelmanager" . to_string ( ) , "Failed to update ChannelMonitor" . to_string ( ) , 1 ) ;
@@ -2106,7 +2106,7 @@ fn test_fail_htlc_on_broadcast_after_claim() {
2106
2106
check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
2107
2107
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
2108
2108
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
2109
- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
2109
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , vec! [ HTLCDestination :: NextHopChannel { node_id : Some ( nodes [ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_id_2 } ] ) ;
2110
2110
2111
2111
nodes[ 0 ] . node . handle_update_fulfill_htlc ( & nodes[ 1 ] . node . get_our_node_id ( ) , & bs_updates. update_fulfill_htlcs [ 0 ] ) ;
2112
2112
expect_payment_sent_without_paths ! ( nodes[ 0 ] , payment_preimage) ;
@@ -2469,7 +2469,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
2469
2469
} ;
2470
2470
if second_fails {
2471
2471
nodes[ 2 ] . node . fail_htlc_backwards ( & payment_hash) ;
2472
- expect_pending_htlcs_forwardable ! ( nodes[ 2 ] ) ;
2472
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 2 ] , vec! [ HTLCDestination :: FailedPayment { payment_hash } ] ) ;
2473
2473
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
2474
2474
get_htlc_update_msgs ! ( nodes[ 2 ] , nodes[ 1 ] . node. get_our_node_id( ) ) ;
2475
2475
} else {
@@ -2505,7 +2505,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
2505
2505
2506
2506
if second_fails {
2507
2507
reconnect_nodes ( & nodes[ 1 ] , & nodes[ 2 ] , ( false , false ) , ( 0 , 0 ) , ( 0 , 0 ) , ( 1 , 0 ) , ( 0 , 0 ) , ( 0 , 0 ) , ( false , false ) ) ;
2508
- expect_pending_htlcs_forwardable ! ( nodes[ 1 ] ) ;
2508
+ expect_pending_htlcs_forwardable_and_htlc_handling_failed ! ( nodes[ 1 ] , vec! [ HTLCDestination :: NextHopChannel { node_id : Some ( nodes [ 2 ] . node . get_our_node_id ( ) ) , channel_id : chan_id_2 } ] ) ;
2509
2509
} else {
2510
2510
reconnect_nodes ( & nodes[ 1 ] , & nodes[ 2 ] , ( false , false ) , ( 0 , 0 ) , ( 1 , 0 ) , ( 0 , 0 ) , ( 0 , 0 ) , ( 0 , 0 ) , ( false , false ) ) ;
2511
2511
}
0 commit comments