Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 1,132 Lines • ▼ Show 20 Lines | |||||
// If there are more signatures left than keys | // If there are more signatures left than keys | ||||
// left, then too many signatures have failed. | // left, then too many signatures have failed. | ||||
// Exit early, without checking any further | // Exit early, without checking any further | ||||
// signatures. | // signatures. | ||||
if (nSigsRemaining > nKeysRemaining) { | if (nSigsRemaining > nKeysRemaining) { | ||||
fSuccess = false; | fSuccess = false; | ||||
} | } | ||||
} | } | ||||
} | |||||
// If the operation failed, we require that all | bool areAllSignaturesNull = true; | ||||
// signatures must be empty vector | |||||
if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL)) { | |||||
for (int i = 0; i < nSigsCount; i++) { | for (int i = 0; i < nSigsCount; i++) { | ||||
if (stacktop(-idxTopSig - i).size()) { | if (stacktop(-idxTopSig - i).size()) { | ||||
areAllSignaturesNull = false; | |||||
break; | |||||
} | |||||
} | |||||
// If the operation failed, we may require that all | |||||
// signatures must be empty vector | |||||
if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && | |||||
!areAllSignaturesNull) { | |||||
return set_error(serror, | return set_error(serror, | ||||
ScriptError::SIG_NULLFAIL); | ScriptError::SIG_NULLFAIL); | ||||
} | } | ||||
} | } | ||||
} | |||||
// Clean up stack of all arguments | // Clean up stack of all arguments | ||||
for (size_t i = 0; i < idxDummy; i++) { | 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) { | ||||
▲ Show 20 Lines • Show All 598 Lines • Show Last 20 Lines |