@@ -4852,8 +4852,7 @@ fn test_claim_on_remote_sizeable_push_msat() {
4852
4852
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 , 1 , true , header. block_hash ( ) ) ;
4853
4853
4854
4854
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , 1 , node_cfgs[ 1 ] . keys_manager, 100000 ) ;
4855
- assert_eq ! ( spend_txn. len( ) , 2 ) ;
4856
- assert_eq ! ( spend_txn[ 0 ] , spend_txn[ 1 ] ) ;
4855
+ assert_eq ! ( spend_txn. len( ) , 1 ) ;
4857
4856
check_spends ! ( spend_txn[ 0 ] , node_txn[ 0 ] ) ;
4858
4857
}
4859
4858
@@ -4885,10 +4884,9 @@ fn test_claim_on_remote_revoked_sizeable_push_msat() {
4885
4884
connect_blocks ( & nodes[ 1 ] , ANTI_REORG_DELAY - 1 , 1 , true , header. block_hash ( ) ) ;
4886
4885
4887
4886
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , 1 , node_cfgs[ 1 ] . keys_manager, 100000 ) ;
4888
- assert_eq ! ( spend_txn. len( ) , 3 ) ;
4889
- assert_eq ! ( spend_txn[ 0 ] , spend_txn[ 1 ] ) ; // to_remote output on revoked remote commitment_tx
4890
- check_spends ! ( spend_txn[ 0 ] , revoked_local_txn[ 0 ] ) ;
4891
- check_spends ! ( spend_txn[ 2 ] , node_txn[ 0 ] ) ;
4887
+ assert_eq ! ( spend_txn. len( ) , 2 ) ;
4888
+ check_spends ! ( spend_txn[ 0 ] , revoked_local_txn[ 0 ] ) ; // to_remote output on revoked remote commitment_tx
4889
+ check_spends ! ( spend_txn[ 1 ] , node_txn[ 0 ] ) ;
4892
4890
}
4893
4891
4894
4892
#[ test]
@@ -4983,8 +4981,8 @@ fn test_static_spendable_outputs_timeout_tx() {
4983
4981
expect_payment_failed ! ( nodes[ 1 ] , our_payment_hash, true ) ;
4984
4982
4985
4983
let spend_txn = check_spendable_outputs ! ( nodes[ 1 ] , 1 , node_cfgs[ 1 ] . keys_manager, 100000 ) ;
4986
- assert_eq ! ( spend_txn. len( ) , 3 ) ; // SpendableOutput: remote_commitment_tx.to_remote (*2) , timeout_tx.output (*1)
4987
- check_spends ! ( spend_txn[ 2 ] , node_txn[ 0 ] . clone ( ) ) ;
4984
+ assert_eq ! ( spend_txn. len( ) , 2 ) ; // SpendableOutput: remote_commitment_tx.to_remote, timeout_tx.output
4985
+ check_spends ! ( spend_txn[ 1 ] , node_txn[ 0 ] ) ;
4988
4986
}
4989
4987
4990
4988
#[ test]
@@ -5159,12 +5157,11 @@ fn test_static_spendable_outputs_justice_tx_revoked_htlc_success_tx() {
5159
5157
5160
5158
// Check A's ChannelMonitor was able to generate the right spendable output descriptor
5161
5159
let spend_txn = check_spendable_outputs ! ( nodes[ 0 ] , 1 , node_cfgs[ 0 ] . keys_manager, 100000 ) ;
5162
- assert_eq ! ( spend_txn. len( ) , 3 ) ; // Duplicated SpendableOutput due to block rescan after revoked htlc output tracking
5163
- assert_eq ! ( spend_txn[ 0 ] , spend_txn[ 1 ] ) ;
5160
+ assert_eq ! ( spend_txn. len( ) , 2 ) ;
5164
5161
assert_eq ! ( spend_txn[ 0 ] . input. len( ) , 1 ) ;
5165
5162
check_spends ! ( spend_txn[ 0 ] , revoked_local_txn[ 0 ] ) ; // spending to_remote output from revoked local tx
5166
5163
assert_ne ! ( spend_txn[ 0 ] . input[ 0 ] . previous_output, revoked_htlc_txn[ 0 ] . input[ 0 ] . previous_output) ;
5167
- check_spends ! ( spend_txn[ 2 ] , node_txn[ 1 ] ) ; // spending justice tx output on the htlc success tx
5164
+ check_spends ! ( spend_txn[ 1 ] , node_txn[ 1 ] ) ; // spending justice tx output on the htlc success tx
5168
5165
}
5169
5166
5170
5167
#[ test]
@@ -5228,7 +5225,7 @@ fn test_onchain_to_onchain_claim() {
5228
5225
assert_eq ! ( b_txn[ 2 ] . input[ 0 ] . witness. clone( ) . last( ) . unwrap( ) . len( ) , OFFERED_HTLC_SCRIPT_WEIGHT ) ;
5229
5226
assert ! ( b_txn[ 2 ] . output[ 0 ] . script_pubkey. is_v0_p2wsh( ) ) ; // revokeable output
5230
5227
assert_ne ! ( b_txn[ 2 ] . lock_time, 0 ) ; // Timeout tx
5231
- check_spends ! ( b_txn[ 0 ] , c_txn[ 1 ] ) ; // timeout tx on C remote commitment tx, issued by ChannelMonitor, * 2 due to block rescan
5228
+ check_spends ! ( b_txn[ 0 ] , c_txn[ 1 ] ) ; // timeout tx on C remote commitment tx, issued by ChannelMonitor
5232
5229
assert_eq ! ( b_txn[ 0 ] . input[ 0 ] . witness. clone( ) . last( ) . unwrap( ) . len( ) , ACCEPTED_HTLC_SCRIPT_WEIGHT ) ;
5233
5230
assert ! ( b_txn[ 0 ] . output[ 0 ] . script_pubkey. is_v0_p2wpkh( ) ) ; // direct payment
5234
5231
assert_ne ! ( b_txn[ 2 ] . lock_time, 0 ) ; // Timeout tx
@@ -5726,10 +5723,9 @@ fn test_dynamic_spendable_outputs_local_htlc_timeout_tx() {
5726
5723
5727
5724
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
5728
5725
let spend_txn = check_spendable_outputs ! ( nodes[ 0 ] , 1 , node_cfgs[ 0 ] . keys_manager, 100000 ) ;
5729
- assert_eq ! ( spend_txn. len( ) , 3 ) ;
5730
- assert_eq ! ( spend_txn[ 0 ] , spend_txn[ 1 ] ) ;
5726
+ assert_eq ! ( spend_txn. len( ) , 2 ) ;
5731
5727
check_spends ! ( spend_txn[ 0 ] , local_txn[ 0 ] ) ;
5732
- check_spends ! ( spend_txn[ 2 ] , htlc_timeout) ;
5728
+ check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5733
5729
}
5734
5730
5735
5731
#[ test]
@@ -5797,10 +5793,9 @@ fn test_key_derivation_params() {
5797
5793
// Verify that A is able to spend its own HTLC-Timeout tx thanks to spendable output event given back by its ChannelMonitor
5798
5794
let new_keys_manager = test_utils:: TestKeysInterface :: new ( & seed, Network :: Testnet ) ;
5799
5795
let spend_txn = check_spendable_outputs ! ( nodes[ 0 ] , 1 , new_keys_manager, 100000 ) ;
5800
- assert_eq ! ( spend_txn. len( ) , 3 ) ;
5801
- assert_eq ! ( spend_txn[ 0 ] , spend_txn[ 1 ] ) ;
5796
+ assert_eq ! ( spend_txn. len( ) , 2 ) ;
5802
5797
check_spends ! ( spend_txn[ 0 ] , local_txn_1[ 0 ] ) ;
5803
- check_spends ! ( spend_txn[ 2 ] , htlc_timeout) ;
5798
+ check_spends ! ( spend_txn[ 1 ] , htlc_timeout) ;
5804
5799
}
5805
5800
5806
5801
#[ test]
0 commit comments