diff --git a/lnwallet/chanfunding/psbt_assembler.go b/lnwallet/chanfunding/psbt_assembler.go index 4d15ff53..75b0e708 100644 --- a/lnwallet/chanfunding/psbt_assembler.go +++ b/lnwallet/chanfunding/psbt_assembler.go @@ -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