MCPcopy Create free account
hub / github.com/ElementsProject/elements / update_validation_weight

Function update_validation_weight

src/script/interpreter.cpp:442–450  ·  view source on GitHub ↗

Check the script has sufficient sigops budget for checksig(crypto) operation

Source from the content-addressed store, hash-verified

440
441// Check the script has sufficient sigops budget for checksig(crypto) operation
442inline bool update_validation_weight(ScriptExecutionData& execdata, ScriptError* serror)
443{
444 assert(execdata.m_validation_weight_left_init);
445 execdata.m_validation_weight_left -= VALIDATION_WEIGHT_PER_SIGOP_PASSED;
446 if (execdata.m_validation_weight_left < 0) {
447 return set_error(serror, SCRIPT_ERR_TAPSCRIPT_VALIDATION_WEIGHT);
448 }
449 return true;
450}
451
452static bool EvalChecksigPreTapscript(const valtype& vchSig, const valtype& vchPubKey, CScript::const_iterator pbegincodehash, CScript::const_iterator pend, unsigned int flags, const BaseSignatureChecker& checker, SigVersion sigversion, ScriptError* serror, bool& fSuccess)
453{

Callers 3

EvalChecksigTapscriptFunction · 0.85
EvalScriptFunction · 0.85

Calls 1

set_errorFunction · 0.70

Tested by

no test coverage detected