@@ -944,23 +944,23 @@ impl KeysManager {
944944 } ;
945945 transaction_utils:: maybe_add_change_output ( & mut spend_tx, input_value, witness_weight, feerate_sat_per_1000_weight, change_destination_script) ?;
946946
947- let mut keys_cache: Option < ( InMemoryChannelKeys , ( u64 , u64 ) ) > = None ;
947+ let mut keys_cache: Option < ( InMemoryChannelKeys , [ u8 ; 32 ] ) > = None ;
948948 let mut input_idx = 0 ;
949949 for outp in descriptors {
950950 match outp {
951951 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 {
953953 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 ) ) ;
956956 }
957957 spend_tx. input [ input_idx] . witness = keys_cache. as_ref ( ) . unwrap ( ) . 0 . sign_counterparty_payment_input ( & spend_tx, input_idx, & descriptor, & secp_ctx) . unwrap ( ) ;
958958 } ,
959959 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 {
961961 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 ) ) ;
964964 }
965965 spend_tx. input [ input_idx] . witness = keys_cache. as_ref ( ) . unwrap ( ) . 0 . sign_dynamic_p2wsh_input ( & spend_tx, input_idx, & descriptor, & secp_ctx) . unwrap ( ) ;
966966 } ,
0 commit comments