@@ -355,25 +355,28 @@ func (t *txInputSet) tryAddWalletInputsIfNeeded() error {
355
355
// createWalletTxInput converts a wallet utxo into an object that can be added
356
356
// to the other inputs to sweep.
357
357
func createWalletTxInput (utxo * lnwallet.Utxo ) (input.Input , error ) {
358
+ signDesc := & input.SignDescriptor {
359
+ Output : & wire.TxOut {
360
+ PkScript : utxo .PkScript ,
361
+ Value : int64 (utxo .Value ),
362
+ },
363
+ HashType : txscript .SigHashAll ,
364
+ }
365
+
358
366
var witnessType input.WitnessType
359
367
switch utxo .AddressType {
360
368
case lnwallet .WitnessPubKey :
361
369
witnessType = input .WitnessKeyHash
362
370
case lnwallet .NestedWitnessPubKey :
363
371
witnessType = input .NestedWitnessKeyHash
372
+ case lnwallet .TaprootPubkey :
373
+ witnessType = input .TaprootPubKeySpend
374
+ signDesc .HashType = txscript .SigHashDefault
364
375
default :
365
376
return nil , fmt .Errorf ("unknown address type %v" ,
366
377
utxo .AddressType )
367
378
}
368
379
369
- signDesc := & input.SignDescriptor {
370
- Output : & wire.TxOut {
371
- PkScript : utxo .PkScript ,
372
- Value : int64 (utxo .Value ),
373
- },
374
- HashType : txscript .SigHashAll ,
375
- }
376
-
377
380
// A height hint doesn't need to be set, because we don't monitor these
378
381
// inputs for spend.
379
382
heightHint := uint32 (0 )
0 commit comments