mirror of
https://github.com/lightningnetwork/lnd.git
synced 2024-11-19 09:53:54 +01:00
lnwallet/chanfunding: assert PSBT Inputs have WitnessUtxo
This commit is contained in:
parent
9e2cccdbbd
commit
b3f14d66f0
@ -249,6 +249,15 @@ func (i *PsbtIntent) Verify(packet *psbt.Packet) error {
|
||||
"output amount sum")
|
||||
}
|
||||
|
||||
// SumUtxoInputValues checks that packet.Inputs is non-empty. Here we
|
||||
// check that each Input has a WitnessUtxo field, to avoid possible
|
||||
// malleability.
|
||||
for _, in := range packet.Inputs {
|
||||
if in.WitnessUtxo == nil {
|
||||
return fmt.Errorf("not all inputs are segwit spends")
|
||||
}
|
||||
}
|
||||
|
||||
i.PendingPsbt = packet
|
||||
i.State = PsbtVerified
|
||||
return nil
|
||||
|
Loading…
Reference in New Issue
Block a user