Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 1,061 Lines • ▼ Show 20 Lines | try { | ||||
// If there are more signatures left than keys left, | // If there are more signatures left than keys left, | ||||
// then too many signatures have failed. Exit early, | // then too many signatures have failed. Exit early, | ||||
// without checking any further signatures. | // without checking any further signatures. | ||||
if (nSigsRemaining > nKeysRemaining) { | if (nSigsRemaining > nKeysRemaining) { | ||||
fSuccess = false; | fSuccess = false; | ||||
} | } | ||||
} | } | ||||
// Clean up stack of actual arguments | |||||
size_t i = idxDummy; | |||||
size_t ikey2 = idxSigCount; | |||||
while (i-- > 1) { | |||||
// If the operation failed, we require that all | // If the operation failed, we require that all | ||||
// signatures must be empty vector | // signatures must be empty vector | ||||
if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && | if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL)) { | ||||
!ikey2 && stacktop(-1).size()) { | for (int i = 0; i < nSigsCount; i++) { | ||||
if (stacktop(-idxTopSig - i).size()) { | |||||
return set_error(serror, | return set_error(serror, | ||||
SCRIPT_ERR_SIG_NULLFAIL); | SCRIPT_ERR_SIG_NULLFAIL); | ||||
} | } | ||||
if (ikey2 > 0) { | |||||
ikey2--; | |||||
} | } | ||||
popstack(stack); | |||||
} | } | ||||
// pop dummy element. | // Clean up stack of all arguments | ||||
for (size_t i = 0; i < idxDummy; i++) { | |||||
popstack(stack); | popstack(stack); | ||||
} | |||||
stack.push_back(fSuccess ? vchTrue : vchFalse); | stack.push_back(fSuccess ? vchTrue : vchFalse); | ||||
if (opcode == OP_CHECKMULTISIGVERIFY) { | if (opcode == OP_CHECKMULTISIGVERIFY) { | ||||
if (fSuccess) { | if (fSuccess) { | ||||
popstack(stack); | popstack(stack); | ||||
} else { | } else { | ||||
return set_error( | return set_error( | ||||
serror, SCRIPT_ERR_CHECKMULTISIGVERIFY); | serror, SCRIPT_ERR_CHECKMULTISIGVERIFY); | ||||
▲ Show 20 Lines • Show All 580 Lines • Show Last 20 Lines |