psbt: don't remove non-witness UTXO for segwit v0
As a countermeasure to CVE-2020-14199 new HW wallet firmwares require the full non-witness UTXO to be set even for witness inputs. We therefore shouldn't remove it when signing.
This commit is contained in:
parent
c5f199e40f
commit
b283b0eb92
1 changed files with 5 additions and 2 deletions
|
@ -142,8 +142,11 @@ func nonWitnessToWitness(p *Packet, inIndex int) error {
|
|||
outIndex := p.UnsignedTx.TxIn[inIndex].PreviousOutPoint.Index
|
||||
txout := p.Inputs[inIndex].NonWitnessUtxo.TxOut[outIndex]
|
||||
|
||||
// Remove the non-witness first, else sanity check will not pass:
|
||||
p.Inputs[inIndex].NonWitnessUtxo = nil
|
||||
// TODO(guggero): For segwit v1, we'll want to remove the NonWitnessUtxo
|
||||
// from the packet. For segwit v0 it is unsafe to only rely on the
|
||||
// witness UTXO. See https://github.com/bitcoin/bitcoin/pull/19215.
|
||||
// p.Inputs[inIndex].NonWitnessUtxo = nil
|
||||
|
||||
u := Updater{
|
||||
Upsbt: p,
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue