diff --git a/psbt/partial_input.go b/psbt/partial_input.go index 3db042f..4783c74 100644 --- a/psbt/partial_input.go +++ b/psbt/partial_input.go @@ -49,19 +49,13 @@ func NewPsbtInput(nonWitnessUtxo *wire.MsgTx, } // IsSane returns true only if there are no conflicting values in the Psbt -// PInput. It checks that witness and non-witness utxo entries do not both -// exist, and that witnessScript entries are only added to witness inputs. +// PInput. For segwit v0 no checks are currently implemented. func (pi *PInput) IsSane() bool { - if pi.NonWitnessUtxo != nil && pi.WitnessUtxo != nil { - return false - } - if pi.WitnessUtxo == nil && pi.WitnessScript != nil { - return false - } - if pi.WitnessUtxo == nil && pi.FinalScriptWitness != nil { - return false - } + // TODO(guggero): Implement sanity checks for segwit v1. For segwit v0 + // it is unsafe to only rely on the witness UTXO so we don't check that + // only one is set anymore. + // See https://github.com/bitcoin/bitcoin/pull/19215. return true } diff --git a/psbt/psbt_test.go b/psbt/psbt_test.go index 7029334..27f3b3f 100644 --- a/psbt/psbt_test.go +++ b/psbt/psbt_test.go @@ -161,6 +161,9 @@ func TestReadInvalidPsbt(t *testing.T) { } func TestSanityCheck(t *testing.T) { + // TODO(guggero): Remove when checks for segwit v1 are implemented. + t.Skip("Skipping PSBT sanity checks for segwit v0.") + // Test strategy: // 1. Create an invalid PSBT from a serialization // Then ensure that the sanity check fails.