@@ -2402,11 +2402,11 @@ fn test_justice_tx_htlc_timeout() {
2402
2402
let mut alice_config = UserConfig :: default ( ) ;
2403
2403
alice_config. channel_handshake_config . announced_channel = true ;
2404
2404
alice_config. channel_handshake_limits . force_announced_channel_preference = false ;
2405
- alice_config. channel_handshake_config . our_to_self_delay = 6 * 24 * 5 ;
2405
+ alice_config. channel_handshake_config . our_to_self_delay = 1008 + 288 ;
2406
2406
let mut bob_config = UserConfig :: default ( ) ;
2407
2407
bob_config. channel_handshake_config . announced_channel = true ;
2408
2408
bob_config. channel_handshake_limits . force_announced_channel_preference = false ;
2409
- bob_config. channel_handshake_config . our_to_self_delay = 6 * 24 * 3 ;
2409
+ bob_config. channel_handshake_config . our_to_self_delay = 1008 + 144 ;
2410
2410
let user_cfgs = [ Some ( alice_config) , Some ( bob_config) ] ;
2411
2411
let mut chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
2412
2412
chanmon_cfgs[ 0 ] . keys_manager . disable_revocation_policy_check = true ;
@@ -2465,11 +2465,11 @@ fn test_justice_tx_htlc_success() {
2465
2465
let mut alice_config = UserConfig :: default ( ) ;
2466
2466
alice_config. channel_handshake_config . announced_channel = true ;
2467
2467
alice_config. channel_handshake_limits . force_announced_channel_preference = false ;
2468
- alice_config. channel_handshake_config . our_to_self_delay = 6 * 24 * 5 ;
2468
+ alice_config. channel_handshake_config . our_to_self_delay = 1008 + 288 ;
2469
2469
let mut bob_config = UserConfig :: default ( ) ;
2470
2470
bob_config. channel_handshake_config . announced_channel = true ;
2471
2471
bob_config. channel_handshake_limits . force_announced_channel_preference = false ;
2472
- bob_config. channel_handshake_config . our_to_self_delay = 6 * 24 * 3 ;
2472
+ bob_config. channel_handshake_config . our_to_self_delay = 1008 + 144 ;
2473
2473
let user_cfgs = [ Some ( alice_config) , Some ( bob_config) ] ;
2474
2474
let mut chanmon_cfgs = create_chanmon_cfgs ( 2 ) ;
2475
2475
chanmon_cfgs[ 0 ] . keys_manager . disable_revocation_policy_check = true ;
@@ -4306,13 +4306,13 @@ fn test_claim_sizeable_push_msat() {
4306
4306
assert_eq ! ( node_txn[ 0 ] . output. len( ) , 2 ) ; // We can't force trimming of to_remote output as channel_reserve_satoshis block us to do so at channel opening
4307
4307
4308
4308
mine_transaction ( & nodes[ 1 ] , & node_txn[ 0 ] ) ;
4309
- connect_blocks ( & nodes[ 1 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
4309
+ connect_blocks ( & nodes[ 1 ] , ( BREAKDOWN_TIMEOUT * 7 ) as u32 - 1 ) ;
4310
4310
4311
4311
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , node_cfgs[ 1 ] . keys_manager) ;
4312
4312
assert_eq ! ( spend_txn. len( ) , 1 ) ;
4313
4313
assert_eq ! ( spend_txn[ 0 ] . input. len( ) , 1 ) ;
4314
4314
check_spends ! ( spend_txn[ 0 ] , node_txn[ 0 ] ) ;
4315
- assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence. 0 , BREAKDOWN_TIMEOUT as u32 ) ;
4315
+ assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence. 0 , ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
4316
4316
}
4317
4317
4318
4318
#[ test]
@@ -4955,14 +4955,14 @@ fn test_dynamic_spendable_outputs_local_htlc_success_tx() {
4955
4955
} ;
4956
4956
4957
4957
mine_transaction ( & nodes[ 1 ] , & node_tx) ;
4958
- connect_blocks ( & nodes[ 1 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
4958
+ connect_blocks ( & nodes[ 1 ] , ( BREAKDOWN_TIMEOUT * 7 ) as u32 - 1 ) ;
4959
4959
4960
4960
// Verify that B is able to spend its own HTLC-Success tx thanks to spendable output event given back by its ChannelMonitor
4961
4961
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , node_cfgs[ 1 ] . keys_manager) ;
4962
4962
assert_eq ! ( spend_txn. len( ) , 1 ) ;
4963
4963
assert_eq ! ( spend_txn[ 0 ] . input. len( ) , 1 ) ;
4964
4964
check_spends ! ( spend_txn[ 0 ] , node_tx) ;
4965
- assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence. 0 , BREAKDOWN_TIMEOUT as u32 ) ;
4965
+ assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence. 0 , ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
4966
4966
}
4967
4967
4968
4968
fn do_test_fail_backwards_unrevoked_remote_announce ( deliver_last_raa : bool , announce_latest : bool ) {
@@ -5303,7 +5303,7 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5303
5303
} ;
5304
5304
5305
5305
mine_transaction ( & nodes[ 0 ] , & htlc_timeout) ;
5306
- connect_blocks ( & nodes[ 0 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
5306
+ connect_blocks ( & nodes[ 0 ] , ( BREAKDOWN_TIMEOUT * 7 ) as u32 - 1 ) ;
5307
5307
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, false ) ;
5308
5308
5309
5309
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
@@ -5312,11 +5312,11 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5312
5312
check_spends ! ( spend_txn[ 0 ] , local_txn[ 0 ] ) ;
5313
5313
assert_eq ! ( spend_txn[ 1 ] . input. len( ) , 1 ) ;
5314
5314
check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5315
- assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence. 0 , BREAKDOWN_TIMEOUT as u32 ) ;
5315
+ assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence. 0 , ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
5316
5316
assert_eq ! ( spend_txn[ 2 ] . input. len( ) , 2 ) ;
5317
5317
check_spends ! ( spend_txn[ 2 ] , local_txn[ 0 ] , htlc_timeout) ;
5318
- assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence. 0 == BREAKDOWN_TIMEOUT as u32 ||
5319
- spend_txn[ 2 ] . input[ 1 ] . sequence. 0 == BREAKDOWN_TIMEOUT as u32 ) ;
5318
+ assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence. 0 == ( BREAKDOWN_TIMEOUT * 7 ) as u32 ||
5319
+ spend_txn[ 2 ] . input[ 1 ] . sequence. 0 == ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
5320
5320
}
5321
5321
5322
5322
#[ test]
@@ -5389,7 +5389,7 @@ fn test_key_derivation_params() {
5389
5389
} ;
5390
5390
5391
5391
mine_transaction ( & nodes[ 0 ] , & htlc_timeout) ;
5392
- connect_blocks ( & nodes[ 0 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
5392
+ connect_blocks ( & nodes[ 0 ] , ( BREAKDOWN_TIMEOUT * 7 ) as u32 - 1 ) ;
5393
5393
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, false ) ;
5394
5394
5395
5395
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
@@ -5399,11 +5399,11 @@ fn test_key_derivation_params() {
5399
5399
check_spends ! ( spend_txn[ 0 ] , local_txn_1[ 0 ] ) ;
5400
5400
assert_eq ! ( spend_txn[ 1 ] . input. len( ) , 1 ) ;
5401
5401
check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5402
- assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence. 0 , BREAKDOWN_TIMEOUT as u32 ) ;
5402
+ assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence. 0 , ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
5403
5403
assert_eq ! ( spend_txn[ 2 ] . input. len( ) , 2 ) ;
5404
5404
check_spends ! ( spend_txn[ 2 ] , local_txn_1[ 0 ] , htlc_timeout) ;
5405
- assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence. 0 == BREAKDOWN_TIMEOUT as u32 ||
5406
- spend_txn[ 2 ] . input[ 1 ] . sequence. 0 == BREAKDOWN_TIMEOUT as u32 ) ;
5405
+ assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence. 0 == ( BREAKDOWN_TIMEOUT * 7 ) as u32 ||
5406
+ spend_txn[ 2 ] . input[ 1 ] . sequence. 0 == ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
5407
5407
}
5408
5408
5409
5409
#[ test]
@@ -5635,8 +5635,8 @@ fn bolt2_open_channel_sending_node_checks_part2() {
5635
5635
assert ! ( node0_to_1_send_open_channel. channel_flags<=1 ) ;
5636
5636
5637
5637
// BOLT #2 spec: Sending node should set to_self_delay sufficient to ensure the sender can irreversibly spend a commitment transaction output, in case of misbehaviour by the receiver.
5638
- assert ! ( BREAKDOWN_TIMEOUT >0 ) ;
5639
- assert ! ( node0_to_1_send_open_channel. to_self_delay==BREAKDOWN_TIMEOUT ) ;
5638
+ assert ! ( ( BREAKDOWN_TIMEOUT * 7 ) >0 ) ;
5639
+ assert ! ( node0_to_1_send_open_channel. to_self_delay==( BREAKDOWN_TIMEOUT * 7 ) ) ;
5640
5640
5641
5641
// BOLT #2 spec: Sending node must ensure the chain_hash value identifies the chain it wishes to open the channel within.
5642
5642
let chain_hash=genesis_block ( Network :: Testnet ) . header . block_hash ( ) ;
@@ -9122,7 +9122,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
9122
9122
9123
9123
let conf_height = nodes[ 1 ] . best_block_info ( ) . 1 ;
9124
9124
if !test_height_before_timelock {
9125
- connect_blocks ( & nodes[ 1 ] , 24 * 6 ) ;
9125
+ connect_blocks ( & nodes[ 1 ] , ( BREAKDOWN_TIMEOUT * 7 ) as u32 ) ;
9126
9126
}
9127
9127
nodes[ 1 ] . chain_monitor . chain_monitor . transactions_confirmed (
9128
9128
& nodes[ 1 ] . get_block_header ( conf_height) , & [ ( 0 , & node_txn[ 0 ] ) ] , conf_height) ;
0 commit comments