Fix PSBT validation

This commit is contained in:
ivanlele 2026-03-18 12:14:06 +00:00 committed by Tom Trevethan
parent c09030b7a1
commit bf2eb667fb
2 changed files with 2 additions and 2 deletions

View file

@ -2024,7 +2024,7 @@ struct PartiallySignedTransaction
// Make sure that all scriptSigs and scriptWitnesses are empty
for (unsigned int i = 0; i < tx->vin.size(); i++) {
const CTxIn& txin = tx->vin[i];
if (!txin.scriptSig.empty() || !tx->witness.vtxinwit[i].scriptWitness.IsNull()) {
if (!txin.scriptSig.empty() || (i < tx->witness.vtxinwit.size() && !tx->witness.vtxinwit[i].scriptWitness.IsNull())) {
throw std::ios_base::failure("Unsigned tx does not have empty scriptSigs and scriptWitnesses.");
}
}

View file

@ -447,7 +447,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test)
QVERIFY(decoded_psbt);
PartiallySignedTransaction psbt;
std::string err;
// QVERIFY(DecodeRawPSBT(psbt, MakeByteSpan(*decoded_psbt), err)); // ELEMENTS FIXME: psbt
QVERIFY(DecodeRawPSBT(psbt, MakeByteSpan(*decoded_psbt), err));
}
void TestGUI(interfaces::Node& node)