@@ -4875,11 +4875,13 @@ fn test_claim_sizeable_push_msat() {
4875
4875
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
4876
4876
4877
4877
mine_transaction ( & nodes[ 1 ] , & node_txn[ 0 ] ) ;
4878
- connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
4878
+ connect_blocks ( & nodes[ 1 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
4879
4879
4880
4880
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , 1 , node_cfgs[ 1 ] . keys_manager, 100000 ) ;
4881
4881
assert_eq ! ( spend_txn. len( ) , 1 ) ;
4882
+ assert_eq ! ( spend_txn[ 0 ] . input. len( ) , 1 ) ;
4882
4883
check_spends ! ( spend_txn[ 0 ] , node_txn[ 0 ] ) ;
4884
+ assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence, BREAKDOWN_TIMEOUT as u32 ) ;
4883
4885
}
4884
4886
4885
4887
#[ test]
@@ -5507,12 +5509,14 @@ fn test_dynamic_spendable_outputs_local_htlc_success_tx() {
5507
5509
} ;
5508
5510
5509
5511
mine_transaction ( & nodes[ 1 ] , & node_tx) ;
5510
- connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 ) ;
5512
+ connect_blocks ( & nodes[ 1 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
5511
5513
5512
5514
// Verify that B is able to spend its own HTLC-Success tx thanks to spendable output event given back by its ChannelMonitor
5513
5515
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , 1 , node_cfgs[ 1 ] . keys_manager, 100000 ) ;
5514
5516
assert_eq ! ( spend_txn. len( ) , 1 ) ;
5517
+ assert_eq ! ( spend_txn[ 0 ] . input. len( ) , 1 ) ;
5515
5518
check_spends ! ( spend_txn[ 0 ] , node_tx) ;
5519
+ assert_eq ! ( spend_txn[ 0 ] . input[ 0 ] . sequence, BREAKDOWN_TIMEOUT as u32 ) ;
5516
5520
}
5517
5521
5518
5522
fn do_test_fail_backwards_unrevoked_remote_announce ( deliver_last_raa : bool , announce_latest : bool ) {
@@ -5802,15 +5806,20 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5802
5806
} ;
5803
5807
5804
5808
mine_transaction ( & nodes[ 0 ] , & htlc_timeout) ;
5805
- connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
5809
+ connect_blocks ( & nodes[ 0 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
5806
5810
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, true ) ;
5807
5811
5808
5812
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
5809
5813
let spend_txn = check_spendable_outputs ! ( nodes[ 0 ] , 1 , node_cfgs[ 0 ] . keys_manager, 100000 ) ;
5810
5814
assert_eq ! ( spend_txn. len( ) , 3 ) ;
5811
5815
check_spends ! ( spend_txn[ 0 ] , local_txn[ 0 ] ) ;
5816
+ assert_eq ! ( spend_txn[ 1 ] . input. len( ) , 1 ) ;
5812
5817
check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5818
+ assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence, BREAKDOWN_TIMEOUT as u32 ) ;
5819
+ assert_eq ! ( spend_txn[ 2 ] . input. len( ) , 2 ) ;
5813
5820
check_spends ! ( spend_txn[ 2 ] , local_txn[ 0 ] , htlc_timeout) ;
5821
+ assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence == BREAKDOWN_TIMEOUT as u32 ||
5822
+ spend_txn[ 2 ] . input[ 1 ] . sequence == BREAKDOWN_TIMEOUT as u32 ) ;
5814
5823
}
5815
5824
5816
5825
#[ test]
@@ -5877,16 +5886,21 @@ fn test_key_derivation_params() {
5877
5886
} ;
5878
5887
5879
5888
mine_transaction ( & nodes[ 0 ] , & htlc_timeout) ;
5880
- connect_blocks ( & nodes[ 0 ] , ANTI_REORG_DELAY - 1 ) ;
5889
+ connect_blocks ( & nodes[ 0 ] , BREAKDOWN_TIMEOUT as u32 - 1 ) ;
5881
5890
expect_payment_failed ! ( nodes[ 0 ] , our_payment_hash, true ) ;
5882
5891
5883
5892
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
5884
5893
let new_keys_manager = test_utils:: TestKeysInterface :: new ( & seed, Network :: Testnet ) ;
5885
5894
let spend_txn = check_spendable_outputs ! ( nodes[ 0 ] , 1 , new_keys_manager, 100000 ) ;
5886
5895
assert_eq ! ( spend_txn. len( ) , 3 ) ;
5887
5896
check_spends ! ( spend_txn[ 0 ] , local_txn_1[ 0 ] ) ;
5897
+ assert_eq ! ( spend_txn[ 1 ] . input. len( ) , 1 ) ;
5888
5898
check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5899
+ assert_eq ! ( spend_txn[ 1 ] . input[ 0 ] . sequence, BREAKDOWN_TIMEOUT as u32 ) ;
5900
+ assert_eq ! ( spend_txn[ 2 ] . input. len( ) , 2 ) ;
5889
5901
check_spends ! ( spend_txn[ 2 ] , local_txn_1[ 0 ] , htlc_timeout) ;
5902
+ assert ! ( spend_txn[ 2 ] . input[ 0 ] . sequence == BREAKDOWN_TIMEOUT as u32 ||
5903
+ spend_txn[ 2 ] . input[ 1 ] . sequence == BREAKDOWN_TIMEOUT as u32 ) ;
5890
5904
}
5891
5905
5892
5906
#[ test]
0 commit comments