@@ -856,7 +856,8 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
856856 let timeout_blocks = TEST_FINAL_CLTV + LATENCY_GRACE_PERIOD_BLOCKS + 1 ;
857857 connect_blocks ( & nodes[ 1 ] , timeout_blocks) ;
858858 let node_1_txn = test_txn_broadcast ( & nodes[ 1 ] , & chan_2, None , HTLCType :: TIMEOUT ) ;
859- check_closed_event ( & nodes[ 1 ] , 1 , ClosureReason :: HTLCsTimedOut , false , & [ node_c_id] , 100_000 ) ;
859+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
860+ check_closed_event ( & nodes[ 1 ] , 1 , reason, false , & [ node_c_id] , 100_000 ) ;
860861 check_closed_broadcast ( & nodes[ 1 ] , 1 , true ) ;
861862 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
862863
@@ -910,7 +911,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
910911 connect_blocks ( & nodes[ 2 ] , TEST_FINAL_CLTV - CLTV_CLAIM_BUFFER + 2 ) ;
911912 let node_2_txn = test_txn_broadcast ( & nodes[ 2 ] , & chan_2, None , HTLCType :: SUCCESS ) ;
912913 check_closed_broadcast ! ( nodes[ 2 ] , true ) ;
913- let reason = ClosureReason :: HTLCsTimedOut ;
914+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash ) } ;
914915 check_closed_event ( & nodes[ 2 ] , 1 , reason, false , & [ node_b_id] , 100_000 ) ;
915916 check_added_monitors ( & nodes[ 2 ] , 1 ) ;
916917
@@ -1160,7 +1161,8 @@ pub fn channel_monitor_network_test() {
11601161 }
11611162 check_added_monitors ( & nodes[ 4 ] , 1 ) ;
11621163 test_txn_broadcast ( & nodes[ 4 ] , & chan_4, None , HTLCType :: SUCCESS ) ;
1163- check_closed_event ! ( nodes[ 4 ] , 1 , ClosureReason :: HTLCsTimedOut , [ node_d_id] , 100000 ) ;
1164+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash_2) } ;
1165+ check_closed_event ! ( nodes[ 4 ] , 1 , reason, [ node_d_id] , 100000 ) ;
11641166
11651167 mine_transaction ( & nodes[ 4 ] , & node_txn[ 0 ] ) ;
11661168 check_preimage_claim ( & nodes[ 4 ] , & node_txn) ;
@@ -1177,7 +1179,8 @@ pub fn channel_monitor_network_test() {
11771179 nodes[ 3 ] . chain_monitor. chain_monitor. watch_channel( chan_3. 2 , chan_3_mon) ,
11781180 Ok ( ChannelMonitorUpdateStatus :: Completed )
11791181 ) ;
1180- check_closed_event ! ( nodes[ 3 ] , 1 , ClosureReason :: HTLCsTimedOut , [ node_id_4] , 100000 ) ;
1182+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash_2) } ;
1183+ check_closed_event ! ( nodes[ 3 ] , 1 , reason, [ node_id_4] , 100000 ) ;
11811184}
11821185
11831186#[ xtest( feature = "_externalize_tests" ) ]
@@ -5321,7 +5324,8 @@ fn do_htlc_claim_local_commitment_only(use_dust: bool) {
53215324 test_txn_broadcast ( & nodes[ 1 ] , & chan, None , htlc_type) ;
53225325 check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
53235326 check_added_monitors ( & nodes[ 1 ] , 1 ) ;
5324- check_closed_event ! ( nodes[ 1 ] , 1 , ClosureReason :: HTLCsTimedOut , [ node_a_id] , 100000 ) ;
5327+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
5328+ check_closed_event ! ( nodes[ 1 ] , 1 , reason, [ node_a_id] , 100000 ) ;
53255329}
53265330
53275331fn do_htlc_claim_current_remote_commitment_only ( use_dust : bool ) {
@@ -5359,7 +5363,8 @@ fn do_htlc_claim_current_remote_commitment_only(use_dust: bool) {
53595363 test_txn_broadcast ( & nodes[ 0 ] , & chan, None , HTLCType :: NONE ) ;
53605364 check_closed_broadcast ! ( nodes[ 0 ] , true ) ;
53615365 check_added_monitors ( & nodes[ 0 ] , 1 ) ;
5362- check_closed_event ! ( nodes[ 0 ] , 1 , ClosureReason :: HTLCsTimedOut , [ node_b_id] , 100000 ) ;
5366+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash) } ;
5367+ check_closed_event ! ( nodes[ 0 ] , 1 , reason, [ node_b_id] , 100000 ) ;
53635368}
53645369
53655370fn do_htlc_claim_previous_remote_commitment_only ( use_dust : bool , check_revoke_no_close : bool ) {
@@ -5414,7 +5419,8 @@ fn do_htlc_claim_previous_remote_commitment_only(use_dust: bool, check_revoke_no
54145419 test_txn_broadcast ( & nodes[ 0 ] , & chan, None , HTLCType :: NONE ) ;
54155420 check_closed_broadcast ! ( nodes[ 0 ] , true ) ;
54165421 check_added_monitors ( & nodes[ 0 ] , 1 ) ;
5417- check_closed_event ! ( nodes[ 0 ] , 1 , ClosureReason :: HTLCsTimedOut , [ node_b_id] , 100000 ) ;
5422+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( our_payment_hash) } ;
5423+ check_closed_event ! ( nodes[ 0 ] , 1 , reason, [ node_b_id] , 100000 ) ;
54185424 } else {
54195425 expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, true ) ;
54205426 }
@@ -8160,7 +8166,7 @@ pub fn test_concurrent_monitor_claim() {
81608166 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 10_000_000 ) ;
81618167
81628168 // Route a HTLC from node 0 to node 1 (but don't settle)
8163- route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 9_000_000 ) ;
8169+ let ( _ , payment_hash_timeout , .. ) = route_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 9_000_000 ) ;
81648170
81658171 // Copy ChainMonitor to simulate watchtower Alice and update block height her ChannelMonitor timeout HTLC onchain
81668172 let chain_source = test_utils:: TestChainSource :: new ( Network :: Testnet ) ;
@@ -8311,7 +8317,8 @@ pub fn test_concurrent_monitor_claim() {
83118317 let height = HTLC_TIMEOUT_BROADCAST + 1 ;
83128318 connect_blocks ( & nodes[ 0 ] , height - nodes[ 0 ] . best_block_info ( ) . 1 ) ;
83138319 check_closed_broadcast ( & nodes[ 0 ] , 1 , true ) ;
8314- check_closed_event ! ( & nodes[ 0 ] , 1 , ClosureReason :: HTLCsTimedOut , false , [ node_b_id] , 100000 ) ;
8320+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash_timeout) } ;
8321+ check_closed_event ! ( & nodes[ 0 ] , 1 , reason, false , [ node_b_id] , 100000 ) ;
83158322 watchtower_alice. chain_monitor . block_connected (
83168323 & create_dummy_block ( BlockHash :: all_zeros ( ) , 42 , vec ! [ bob_state_y. clone( ) ] ) ,
83178324 height,
0 commit comments