Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 1,000 Lines • ▼ Show 20 Lines | try { | ||||
// stack depth of the dummy element | // stack depth of the dummy element | ||||
const size_t idxDummy = idxTopSig + nSigsCount; | const size_t idxDummy = idxTopSig + nSigsCount; | ||||
if (stack.size() < idxDummy) { | if (stack.size() < idxDummy) { | ||||
return set_error( | return set_error( | ||||
serror, SCRIPT_ERR_INVALID_STACK_OPERATION); | serror, SCRIPT_ERR_INVALID_STACK_OPERATION); | ||||
} | } | ||||
bool fSuccess = true; | |||||
// Subset of script starting at the most recent | |||||
// codeseparator | |||||
CScript scriptCode(pbegincodehash, pend); | |||||
// A bug causes CHECKMULTISIG to consume one extra | // A bug causes CHECKMULTISIG to consume one extra | ||||
// argument whose contents were not checked in any way. | // argument whose contents were not checked in any way. | ||||
// | // | ||||
// Unfortunately this is a potential source of | // Unfortunately this is a potential source of | ||||
// mutability, so optionally verify it is exactly equal | // mutability, so optionally verify it is exactly equal | ||||
// to zero. | // to zero. | ||||
if ((flags & SCRIPT_VERIFY_NULLDUMMY) && | if ((flags & SCRIPT_VERIFY_NULLDUMMY) && | ||||
stacktop(-idxDummy).size()) { | stacktop(-idxDummy).size()) { | ||||
return set_error(serror, SCRIPT_ERR_SIG_NULLDUMMY); | return set_error(serror, SCRIPT_ERR_SIG_NULLDUMMY); | ||||
} | } | ||||
// Subset of script starting at the most recent | |||||
// codeseparator | |||||
CScript scriptCode(pbegincodehash, pend); | |||||
// Remove signature for pre-fork scripts | // Remove signature for pre-fork scripts | ||||
for (int k = 0; k < nSigsCount; k++) { | for (int k = 0; k < nSigsCount; k++) { | ||||
valtype &vchSig = stacktop(-idxTopSig - k); | valtype &vchSig = stacktop(-idxTopSig - k); | ||||
CleanupScriptCode(scriptCode, vchSig, flags); | CleanupScriptCode(scriptCode, vchSig, flags); | ||||
} | } | ||||
bool fSuccess = true; | |||||
size_t ikey = idxTopKey; | size_t ikey = idxTopKey; | ||||
size_t isig = idxTopSig; | size_t isig = idxTopSig; | ||||
int nSigsRemaining = nSigsCount; | int nSigsRemaining = nSigsCount; | ||||
int nKeysRemaining = nKeysCount; | int nKeysRemaining = nKeysCount; | ||||
while (fSuccess && nSigsRemaining > 0) { | while (fSuccess && nSigsRemaining > 0) { | ||||
valtype &vchSig = stacktop(-isig); | valtype &vchSig = stacktop(-isig); | ||||
valtype &vchPubKey = stacktop(-ikey); | valtype &vchPubKey = stacktop(-ikey); | ||||
▲ Show 20 Lines • Show All 638 Lines • Show Last 20 Lines |