@@ -202,6 +202,15 @@ pub enum SpendableOutputDescriptor {
202
202
outpoint : OutPoint ,
203
203
/// The output which is referenced by the given outpoint.
204
204
output : TxOut ,
205
+ /// The `channel_keys_id` for the channel which this output came from.
206
+ ///
207
+ /// For channels which were generated on LDK 0.0.119 or later, this is the value which was
208
+ /// passed to the [`SignerProvider::get_destination_script`] call which provided this
209
+ /// output script.
210
+ ///
211
+ /// For channels which were generated prior to LDK 0.0.119, no such argument existed,
212
+ /// however this field may still be filled in if such data is available.
213
+ channel_keys_id : Option < [ u8 ; 32 ] >
205
214
} ,
206
215
/// An output to a P2WSH script which can be spent with a single signature after an `OP_CSV`
207
216
/// delay.
@@ -265,6 +274,7 @@ pub enum SpendableOutputDescriptor {
265
274
impl_writeable_tlv_based_enum ! ( SpendableOutputDescriptor ,
266
275
( 0 , StaticOutput ) => {
267
276
( 0 , outpoint, required) ,
277
+ ( 1 , channel_keys_id, option) ,
268
278
( 2 , output, required) ,
269
279
} ,
270
280
;
@@ -365,7 +375,7 @@ impl SpendableOutputDescriptor {
365
375
{ witness_weight -= 1 ; } // Guarantees a low R signature
366
376
input_value += descriptor. output . value ;
367
377
} ,
368
- SpendableOutputDescriptor :: StaticOutput { ref outpoint, ref output } => {
378
+ SpendableOutputDescriptor :: StaticOutput { ref outpoint, ref output, .. } => {
369
379
if !output_set. insert ( * outpoint) { return Err ( ( ) ) ; }
370
380
input. push ( TxIn {
371
381
previous_output : outpoint. into_bitcoin_outpoint ( ) ,
@@ -1640,7 +1650,7 @@ impl KeysManager {
1640
1650
let witness = keys_cache. as_ref ( ) . unwrap ( ) . 0 . sign_dynamic_p2wsh_input ( & psbt. unsigned_tx , input_idx, & descriptor, & secp_ctx) ?;
1641
1651
psbt. inputs [ input_idx] . final_script_witness = Some ( witness) ;
1642
1652
} ,
1643
- SpendableOutputDescriptor :: StaticOutput { ref outpoint, ref output } => {
1653
+ SpendableOutputDescriptor :: StaticOutput { ref outpoint, ref output, .. } => {
1644
1654
let input_idx = psbt. unsigned_tx . input . iter ( ) . position ( |i| i. previous_output == outpoint. into_bitcoin_outpoint ( ) ) . ok_or ( ( ) ) ?;
1645
1655
let derivation_idx = if output. script_pubkey == self . destination_script {
1646
1656
1
0 commit comments