Changeset View
Changeset View
Standalone View
Standalone View
src/script/interpreter.cpp
Show First 20 Lines • Show All 868 Lines • ▼ Show 20 Lines | try { | ||||
if (!CheckTransactionSignatureEncoding(vchSig, flags, | if (!CheckTransactionSignatureEncoding(vchSig, flags, | ||||
serror) || | serror) || | ||||
!CheckPubKeyEncoding(vchPubKey, flags, serror)) { | !CheckPubKeyEncoding(vchPubKey, flags, serror)) { | ||||
// serror is set | // serror is set | ||||
return false; | return false; | ||||
} | } | ||||
bool fSuccess = false; | |||||
if (vchSig.size()) { | |||||
// Subset of script starting at the most recent | // Subset of script starting at the most recent | ||||
// codeseparator | // codeseparator | ||||
CScript scriptCode(pbegincodehash, pend); | CScript scriptCode(pbegincodehash, pend); | ||||
// Remove signature for pre-fork scripts | // Remove signature for pre-fork scripts | ||||
CleanupScriptCode(scriptCode, vchSig, flags); | CleanupScriptCode(scriptCode, vchSig, flags); | ||||
bool fSuccess = checker.CheckSig(vchSig, vchPubKey, | fSuccess = checker.CheckSig(vchSig, vchPubKey, | ||||
scriptCode, flags); | scriptCode, flags); | ||||
if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && | if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL)) { | ||||
vchSig.size()) { | return set_error(serror, | ||||
return set_error(serror, ScriptError::SIG_NULLFAIL); | ScriptError::SIG_NULLFAIL); | ||||
} | |||||
} | } | ||||
popstack(stack); | popstack(stack); | ||||
popstack(stack); | popstack(stack); | ||||
stack.push_back(fSuccess ? vchTrue : vchFalse); | stack.push_back(fSuccess ? vchTrue : vchFalse); | ||||
if (opcode == OP_CHECKSIGVERIFY) { | if (opcode == OP_CHECKSIGVERIFY) { | ||||
if (fSuccess) { | if (fSuccess) { | ||||
popstack(stack); | popstack(stack); | ||||
Show All 26 Lines | try { | ||||
bool fSuccess = false; | bool fSuccess = false; | ||||
if (vchSig.size()) { | if (vchSig.size()) { | ||||
valtype vchHash(32); | valtype vchHash(32); | ||||
CSHA256() | CSHA256() | ||||
.Write(vchMessage.data(), vchMessage.size()) | .Write(vchMessage.data(), vchMessage.size()) | ||||
.Finalize(vchHash.data()); | .Finalize(vchHash.data()); | ||||
fSuccess = checker.VerifySignature( | fSuccess = checker.VerifySignature( | ||||
vchSig, CPubKey(vchPubKey), uint256(vchHash)); | vchSig, CPubKey(vchPubKey), uint256(vchHash)); | ||||
} | |||||
if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && | if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL)) { | ||||
vchSig.size()) { | return set_error(serror, | ||||
return set_error(serror, ScriptError::SIG_NULLFAIL); | ScriptError::SIG_NULLFAIL); | ||||
} | |||||
} | } | ||||
popstack(stack); | popstack(stack); | ||||
popstack(stack); | popstack(stack); | ||||
popstack(stack); | popstack(stack); | ||||
stack.push_back(fSuccess ? vchTrue : vchFalse); | stack.push_back(fSuccess ? vchTrue : vchFalse); | ||||
if (opcode == OP_CHECKDATASIGVERIFY) { | if (opcode == OP_CHECKDATASIGVERIFY) { | ||||
if (fSuccess) { | if (fSuccess) { | ||||
▲ Show 20 Lines • Show All 819 Lines • Show Last 20 Lines |