mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-01-19 05:45:21 +01:00
rpcwallet: fix p2tr inputs in remote signing
The SendOutputs method isn't used very often in our code so the missing Taproot sighash type wasn't detected before. Also, a P2TR input will never have a sigScript, so we can explicitly set that parameter to nil instead of relying on it being nil anyway.
This commit is contained in:
parent
8bc16b4fb2
commit
df1ea46d9e
@ -159,6 +159,10 @@ func (r *RPCKeyRing) SendOutputs(outputs []*wire.TxOut,
|
||||
return nil, fmt.Errorf("error looking up utxo: %v", err)
|
||||
}
|
||||
|
||||
if txscript.IsPayToTaproot(info.PkScript) {
|
||||
signDesc.HashType = txscript.SigHashDefault
|
||||
}
|
||||
|
||||
// Now that we know the input is ours, we'll populate the
|
||||
// signDesc with the per input unique information.
|
||||
signDesc.Output = &wire.TxOut{
|
||||
@ -593,7 +597,7 @@ func (r *RPCKeyRing) ComputeInputScript(tx *wire.MsgTx,
|
||||
signDesc.SignMethod = input.TaprootKeySpendBIP0086SignMethod
|
||||
signDesc.WitnessScript = nil
|
||||
|
||||
sig, err := r.remoteSign(tx, signDesc, sigScript)
|
||||
sig, err := r.remoteSign(tx, signDesc, nil)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error signing with remote"+
|
||||
"instance: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user