lnwallet/btcwallet: Use signDesc.HashType when signing
Tis commit makes the btcwallet signer implementation use signDesc.HashType instead of SigHashAll when signing transactions. This will allow the creator of the transaction to specify the sighash policy when creating the accompanying sign descriptior.
This commit is contained in:
parent
0ec22cc897
commit
f12dfe2c45
@ -141,7 +141,7 @@ func (b *BtcWallet) SignOutputRaw(tx *wire.MsgTx,
|
|||||||
|
|
||||||
amt := signDesc.Output.Value
|
amt := signDesc.Output.Value
|
||||||
sig, err := txscript.RawTxInWitnessSignature(tx, signDesc.SigHashes,
|
sig, err := txscript.RawTxInWitnessSignature(tx, signDesc.SigHashes,
|
||||||
signDesc.InputIndex, amt, witnessScript, txscript.SigHashAll,
|
signDesc.InputIndex, amt, witnessScript, signDesc.HashType,
|
||||||
privKey)
|
privKey)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@ -227,7 +227,7 @@ func (b *BtcWallet) ComputeInputScript(tx *wire.MsgTx,
|
|||||||
// TODO(roasbeef): adhere to passed HashType
|
// TODO(roasbeef): adhere to passed HashType
|
||||||
witnessScript, err := txscript.WitnessSignature(tx, signDesc.SigHashes,
|
witnessScript, err := txscript.WitnessSignature(tx, signDesc.SigHashes,
|
||||||
signDesc.InputIndex, signDesc.Output.Value, witnessProgram,
|
signDesc.InputIndex, signDesc.Output.Value, witnessProgram,
|
||||||
txscript.SigHashAll, privKey, true)
|
signDesc.HashType, privKey, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user