@@ -856,7 +856,8 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
856
856
let timeout_blocks = TEST_FINAL_CLTV + LATENCY_GRACE_PERIOD_BLOCKS + 1 ;
857
857
connect_blocks ( & nodes[ 1 ] , timeout_blocks) ;
858
858
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 ) ;
860
861
check_closed_broadcast ( & nodes[ 1 ] , 1 , true ) ;
861
862
check_added_monitors ( & nodes[ 1 ] , 1 ) ;
862
863
@@ -910,7 +911,7 @@ fn do_test_fail_back_before_backwards_timeout(post_fail_back_action: PostFailBac
910
911
connect_blocks ( & nodes[ 2 ] , TEST_FINAL_CLTV - CLTV_CLAIM_BUFFER + 2 ) ;
911
912
let node_2_txn = test_txn_broadcast ( & nodes[ 2 ] , & chan_2, None , HTLCType :: SUCCESS ) ;
912
913
check_closed_broadcast ! ( nodes[ 2 ] , true ) ;
913
- let reason = ClosureReason :: HTLCsTimedOut ;
914
+ let reason = ClosureReason :: HTLCsTimedOut { payment_hash : Some ( payment_hash ) } ;
914
915
check_closed_event ( & nodes[ 2 ] , 1 , reason, false , & [ node_b_id] , 100_000 ) ;
915
916
check_added_monitors ( & nodes[ 2 ] , 1 ) ;
916
917
@@ -1160,7 +1161,8 @@ pub fn channel_monitor_network_test() {
1160
1161
}
1161
1162
check_added_monitors ( & nodes[ 4 ] , 1 ) ;
1162
1163
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 ) ;
1164
1166
1165
1167
mine_transaction ( & nodes[ 4 ] , & node_txn[ 0 ] ) ;
1166
1168
check_preimage_claim ( & nodes[ 4 ] , & node_txn) ;
@@ -1177,7 +1179,8 @@ pub fn channel_monitor_network_test() {
1177
1179
nodes[ 3 ] . chain_monitor. chain_monitor. watch_channel( chan_3. 2 , chan_3_mon) ,
1178
1180
Ok ( ChannelMonitorUpdateStatus :: Completed )
1179
1181
) ;
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 ) ;
1181
1184
}
1182
1185
1183
1186
#[ xtest( feature = "_externalize_tests" ) ]
@@ -5321,7 +5324,8 @@ fn do_htlc_claim_local_commitment_only(use_dust: bool) {
5321
5324
test_txn_broadcast ( & nodes[ 1 ] , & chan, None , htlc_type) ;
5322
5325
check_closed_broadcast ! ( nodes[ 1 ] , true ) ;
5323
5326
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 ) ;
5325
5329
}
5326
5330
5327
5331
fn 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) {
5359
5363
test_txn_broadcast ( & nodes[ 0 ] , & chan, None , HTLCType :: NONE ) ;
5360
5364
check_closed_broadcast ! ( nodes[ 0 ] , true ) ;
5361
5365
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 ) ;
5363
5368
}
5364
5369
5365
5370
fn 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
5414
5419
test_txn_broadcast ( & nodes[ 0 ] , & chan, None , HTLCType :: NONE ) ;
5415
5420
check_closed_broadcast ! ( nodes[ 0 ] , true ) ;
5416
5421
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 ) ;
5418
5424
} else {
5419
5425
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, true ) ;
5420
5426
}
@@ -8160,7 +8166,7 @@ pub fn test_concurrent_monitor_claim() {
8160
8166
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 10_000_000 ) ;
8161
8167
8162
8168
// 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 ) ;
8164
8170
8165
8171
// Copy ChainMonitor to simulate watchtower Alice and update block height her ChannelMonitor timeout HTLC onchain
8166
8172
let chain_source = test_utils:: TestChainSource :: new ( Network :: Testnet ) ;
@@ -8311,7 +8317,8 @@ pub fn test_concurrent_monitor_claim() {
8311
8317
let height = HTLC_TIMEOUT_BROADCAST + 1 ;
8312
8318
connect_blocks ( & nodes[ 0 ] , height - nodes[ 0 ] . best_block_info ( ) . 1 ) ;
8313
8319
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 ) ;
8315
8322
watchtower_alice. chain_monitor . block_connected (
8316
8323
& create_dummy_block ( BlockHash :: all_zeros ( ) , 42 , vec ! [ bob_state_y. clone( ) ] ) ,
8317
8324
height,
0 commit comments