Skip to content

Commit bf2eb66

Browse files
ivanleletomt1664
authored andcommitted
Fix PSBT validation
1 parent c09030b commit bf2eb66

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/psbt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2024,7 +2024,7 @@ struct PartiallySignedTransaction
20242024
// Make sure that all scriptSigs and scriptWitnesses are empty
20252025
for (unsigned int i = 0; i < tx->vin.size(); i++) {
20262026
const CTxIn& txin = tx->vin[i];
2027-
if (!txin.scriptSig.empty() || !tx->witness.vtxinwit[i].scriptWitness.IsNull()) {
2027+
if (!txin.scriptSig.empty() || (i < tx->witness.vtxinwit.size() && !tx->witness.vtxinwit[i].scriptWitness.IsNull())) {
20282028
throw std::ios_base::failure("Unsigned tx does not have empty scriptSigs and scriptWitnesses.");
20292029
}
20302030
}

src/qt/test/wallettests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void TestGUIWatchOnly(interfaces::Node& node, TestChain100Setup& test)
447447
QVERIFY(decoded_psbt);
448448
PartiallySignedTransaction psbt;
449449
std::string err;
450-
// QVERIFY(DecodeRawPSBT(psbt, MakeByteSpan(*decoded_psbt), err)); // ELEMENTS FIXME: psbt
450+
QVERIFY(DecodeRawPSBT(psbt, MakeByteSpan(*decoded_psbt), err));
451451
}
452452

453453
void TestGUI(interfaces::Node& node)

0 commit comments

Comments
 (0)