@@ -2395,11 +2395,11 @@ fn test_justice_tx_htlc_timeout() {
2395
2395
let mut alice_config = UserConfig::default();
2396
2396
alice_config.channel_handshake_config.announced_channel = true;
2397
2397
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
2398
- alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5 ;
2398
+ alice_config.channel_handshake_config.our_to_self_delay = 1008 + 288 ;
2399
2399
let mut bob_config = UserConfig::default();
2400
2400
bob_config.channel_handshake_config.announced_channel = true;
2401
2401
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
2402
- bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3 ;
2402
+ bob_config.channel_handshake_config.our_to_self_delay = 1008 + 144 ;
2403
2403
let user_cfgs = [Some(alice_config), Some(bob_config)];
2404
2404
let mut chanmon_cfgs = create_chanmon_cfgs(2);
2405
2405
chanmon_cfgs[0].keys_manager.disable_revocation_policy_check = true;
@@ -2458,11 +2458,11 @@ fn test_justice_tx_htlc_success() {
2458
2458
let mut alice_config = UserConfig::default();
2459
2459
alice_config.channel_handshake_config.announced_channel = true;
2460
2460
alice_config.channel_handshake_limits.force_announced_channel_preference = false;
2461
- alice_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 5 ;
2461
+ alice_config.channel_handshake_config.our_to_self_delay = 1008 + 288 ;
2462
2462
let mut bob_config = UserConfig::default();
2463
2463
bob_config.channel_handshake_config.announced_channel = true;
2464
2464
bob_config.channel_handshake_limits.force_announced_channel_preference = false;
2465
- bob_config.channel_handshake_config.our_to_self_delay = 6 * 24 * 3 ;
2465
+ bob_config.channel_handshake_config.our_to_self_delay = 1008 + 144 ;
2466
2466
let user_cfgs = [Some(alice_config), Some(bob_config)];
2467
2467
let mut chanmon_cfgs = create_chanmon_cfgs(2);
2468
2468
chanmon_cfgs[0].keys_manager.disable_revocation_policy_check = true;
@@ -4299,13 +4299,13 @@ fn test_claim_sizeable_push_msat() {
4299
4299
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
4300
4300
4301
4301
mine_transaction(&nodes[1], &node_txn[0]);
4302
- connect_blocks(&nodes[1], BREAKDOWN_TIMEOUT as u32 - 1);
4302
+ connect_blocks(&nodes[1], ( BREAKDOWN_TIMEOUT * 7) as u32 - 1);
4303
4303
4304
4304
let spend_txn = check_spendable_outputs!(nodes[1], node_cfgs[1].keys_manager);
4305
4305
assert_eq!(spend_txn.len(), 1);
4306
4306
assert_eq!(spend_txn[0].input.len(), 1);
4307
4307
check_spends!(spend_txn[0], node_txn[0]);
4308
- assert_eq!(spend_txn[0].input[0].sequence.0, BREAKDOWN_TIMEOUT as u32);
4308
+ assert_eq!(spend_txn[0].input[0].sequence.0, ( BREAKDOWN_TIMEOUT * 7) as u32);
4309
4309
}
4310
4310
4311
4311
#[test]
@@ -4951,14 +4951,14 @@ fn test_dynamic_spendable_outputs_local_htlc_success_tx() {
4951
4951
};
4952
4952
4953
4953
mine_transaction(&nodes[1], &node_tx);
4954
- connect_blocks(&nodes[1], BREAKDOWN_TIMEOUT as u32 - 1);
4954
+ connect_blocks(&nodes[1], ( BREAKDOWN_TIMEOUT * 7) as u32 - 1);
4955
4955
4956
4956
// Verify that B is able to spend its own HTLC-Success tx thanks to spendable output event given back by its ChannelMonitor
4957
4957
let spend_txn = check_spendable_outputs!(nodes[1], node_cfgs[1].keys_manager);
4958
4958
assert_eq!(spend_txn.len(), 1);
4959
4959
assert_eq!(spend_txn[0].input.len(), 1);
4960
4960
check_spends!(spend_txn[0], node_tx);
4961
- assert_eq!(spend_txn[0].input[0].sequence.0, BREAKDOWN_TIMEOUT as u32);
4961
+ assert_eq!(spend_txn[0].input[0].sequence.0, ( BREAKDOWN_TIMEOUT * 7) as u32);
4962
4962
}
4963
4963
4964
4964
fn do_test_fail_backwards_unrevoked_remote_announce(deliver_last_raa: bool, announce_latest: bool) {
@@ -5299,7 +5299,7 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5299
5299
};
5300
5300
5301
5301
mine_transaction(&nodes[0], &htlc_timeout);
5302
- connect_blocks(&nodes[0], BREAKDOWN_TIMEOUT as u32 - 1);
5302
+ connect_blocks(&nodes[0], ( BREAKDOWN_TIMEOUT * 7) as u32 - 1);
5303
5303
expect_payment_failed!(nodes[0], our_payment_hash, false);
5304
5304
5305
5305
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
@@ -5308,11 +5308,11 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5308
5308
check_spends!(spend_txn[0], local_txn[0]);
5309
5309
assert_eq!(spend_txn[1].input.len(), 1);
5310
5310
check_spends!(spend_txn[1], htlc_timeout);
5311
- assert_eq!(spend_txn[1].input[0].sequence.0, BREAKDOWN_TIMEOUT as u32);
5311
+ assert_eq!(spend_txn[1].input[0].sequence.0, ( BREAKDOWN_TIMEOUT * 7) as u32);
5312
5312
assert_eq!(spend_txn[2].input.len(), 2);
5313
5313
check_spends!(spend_txn[2], local_txn[0], htlc_timeout);
5314
- assert!(spend_txn[2].input[0].sequence.0 == BREAKDOWN_TIMEOUT as u32 ||
5315
- spend_txn[2].input[1].sequence.0 == BREAKDOWN_TIMEOUT as u32);
5314
+ assert!(spend_txn[2].input[0].sequence.0 == ( BREAKDOWN_TIMEOUT * 7) as u32 ||
5315
+ spend_txn[2].input[1].sequence.0 == ( BREAKDOWN_TIMEOUT * 7) as u32);
5316
5316
}
5317
5317
5318
5318
#[test]
@@ -5385,7 +5385,7 @@ fn test_key_derivation_params() {
5385
5385
};
5386
5386
5387
5387
mine_transaction(&nodes[0], &htlc_timeout);
5388
- connect_blocks(&nodes[0], BREAKDOWN_TIMEOUT as u32 - 1);
5388
+ connect_blocks(&nodes[0], ( BREAKDOWN_TIMEOUT * 7) as u32 - 1);
5389
5389
expect_payment_failed!(nodes[0], our_payment_hash, false);
5390
5390
5391
5391
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
@@ -5395,11 +5395,11 @@ fn test_key_derivation_params() {
5395
5395
check_spends!(spend_txn[0], local_txn_1[0]);
5396
5396
assert_eq!(spend_txn[1].input.len(), 1);
5397
5397
check_spends!(spend_txn[1], htlc_timeout);
5398
- assert_eq!(spend_txn[1].input[0].sequence.0, BREAKDOWN_TIMEOUT as u32);
5398
+ assert_eq!(spend_txn[1].input[0].sequence.0, ( BREAKDOWN_TIMEOUT * 7) as u32);
5399
5399
assert_eq!(spend_txn[2].input.len(), 2);
5400
5400
check_spends!(spend_txn[2], local_txn_1[0], htlc_timeout);
5401
- assert!(spend_txn[2].input[0].sequence.0 == BREAKDOWN_TIMEOUT as u32 ||
5402
- spend_txn[2].input[1].sequence.0 == BREAKDOWN_TIMEOUT as u32);
5401
+ assert!(spend_txn[2].input[0].sequence.0 == ( BREAKDOWN_TIMEOUT * 7) as u32 ||
5402
+ spend_txn[2].input[1].sequence.0 == ( BREAKDOWN_TIMEOUT * 7) as u32);
5403
5403
}
5404
5404
5405
5405
#[test]
@@ -5637,8 +5637,8 @@ fn bolt2_open_channel_sending_node_checks_part2() {
5637
5637
assert!(node0_to_1_send_open_channel.channel_flags<=1);
5638
5638
5639
5639
// 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.
5640
- assert!(BREAKDOWN_TIMEOUT>0);
5641
- assert!(node0_to_1_send_open_channel.to_self_delay==BREAKDOWN_TIMEOUT);
5640
+ assert!(( BREAKDOWN_TIMEOUT*7) >0);
5641
+ assert!(node0_to_1_send_open_channel.to_self_delay==( BREAKDOWN_TIMEOUT*7) );
5642
5642
5643
5643
// BOLT #2 spec: Sending node must ensure the chain_hash value identifies the chain it wishes to open the channel within.
5644
5644
let chain_hash=genesis_block(Network::Testnet).header.block_hash();
@@ -9245,7 +9245,7 @@ fn do_test_tx_confirmed_skipping_blocks_immediate_broadcast(test_height_before_t
9245
9245
9246
9246
let conf_height = nodes[1].best_block_info().1;
9247
9247
if !test_height_before_timelock {
9248
- connect_blocks(&nodes[1], 24 * 6 );
9248
+ connect_blocks(&nodes[1], (BREAKDOWN_TIMEOUT*7) as u32 );
9249
9249
}
9250
9250
nodes[1].chain_monitor.chain_monitor.transactions_confirmed(
9251
9251
&nodes[1].get_block_header(conf_height), &[(0, &node_txn[0])], conf_height);
0 commit comments