@@ -944,23 +944,23 @@ impl KeysManager {
944
944
} ;
945
945
transaction_utils:: maybe_add_change_output ( & mut spend_tx, input_value, witness_weight, feerate_sat_per_1000_weight, change_destination_script) ?;
946
946
947
- let mut keys_cache: Option < ( InMemoryChannelKeys , ( u64 , u64 ) ) > = None ;
947
+ let mut keys_cache: Option < ( InMemoryChannelKeys , [ u8 ; 32 ] ) > = None ;
948
948
let mut input_idx = 0 ;
949
949
for outp in descriptors {
950
950
match outp {
951
951
SpendableOutputDescriptor :: StaticOutputCounterpartyPayment ( descriptor) => {
952
- if keys_cache. is_none ( ) || keys_cache. as_ref ( ) . unwrap ( ) . 1 != descriptor. key_derivation_params {
952
+ if keys_cache. is_none ( ) || keys_cache. as_ref ( ) . unwrap ( ) . 1 != descriptor. channel_keys_id {
953
953
keys_cache = Some ( (
954
- self . derive_channel_keys ( descriptor. channel_value_satoshis , descriptor. key_derivation_params . 0 , descriptor . key_derivation_params . 1 ) ,
955
- descriptor. key_derivation_params ) ) ;
954
+ self . derive_channel_keys ( descriptor. channel_value_satoshis , & descriptor. channel_keys_id ) ,
955
+ descriptor. channel_keys_id ) ) ;
956
956
}
957
957
spend_tx. input [ input_idx] . witness = keys_cache. as_ref ( ) . unwrap ( ) . 0 . sign_counterparty_payment_input ( & spend_tx, input_idx, & descriptor, & secp_ctx) . unwrap ( ) ;
958
958
} ,
959
959
SpendableOutputDescriptor :: DynamicOutputP2WSH ( descriptor) => {
960
- if keys_cache. is_none ( ) || keys_cache. as_ref ( ) . unwrap ( ) . 1 != descriptor. key_derivation_params {
960
+ if keys_cache. is_none ( ) || keys_cache. as_ref ( ) . unwrap ( ) . 1 != descriptor. channel_keys_id {
961
961
keys_cache = Some ( (
962
- self . derive_channel_keys ( descriptor. channel_value_satoshis , descriptor. key_derivation_params . 0 , descriptor . key_derivation_params . 1 ) ,
963
- descriptor. key_derivation_params ) ) ;
962
+ self . derive_channel_keys ( descriptor. channel_value_satoshis , & descriptor. channel_keys_id ) ,
963
+ descriptor. channel_keys_id ) ) ;
964
964
}
965
965
spend_tx. input [ input_idx] . witness = keys_cache. as_ref ( ) . unwrap ( ) . 0 . sign_dynamic_p2wsh_input ( & spend_tx, input_idx, & descriptor, & secp_ctx) . unwrap ( ) ;
966
966
} ,
0 commit comments