| 450 | } |
| 451 | |
| 452 | static 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 | { |
| 454 | assert(sigversion == SigVersion::BASE || sigversion == SigVersion::WITNESS_V0); |
| 455 | |
| 456 | // Subset of script starting at the most recent codeseparator |
| 457 | CScript scriptCode(pbegincodehash, pend); |
| 458 | |
| 459 | // Drop the signature in pre-segwit scripts but not segwit scripts |
| 460 | if (sigversion == SigVersion::BASE) { |
| 461 | int found = FindAndDelete(scriptCode, CScript() << vchSig); |
| 462 | if (found > 0 && (flags & SCRIPT_VERIFY_CONST_SCRIPTCODE)) |
| 463 | return set_error(serror, SCRIPT_ERR_SIG_FINDANDDELETE); |
| 464 | } |
| 465 | |
| 466 | if (!CheckSignatureEncoding(vchSig, flags, serror) || !CheckPubKeyEncoding(vchPubKey, flags, sigversion, serror)) { |
| 467 | //serror is set |
| 468 | return false; |
| 469 | } |
| 470 | fSuccess = checker.CheckECDSASignature(vchSig, vchPubKey, scriptCode, sigversion, flags); |
| 471 | |
| 472 | if (!fSuccess && (flags & SCRIPT_VERIFY_NULLFAIL) && vchSig.size()) |
| 473 | return set_error(serror, SCRIPT_ERR_SIG_NULLFAIL); |
| 474 | |
| 475 | return true; |
| 476 | } |
| 477 | |
| 478 | static bool EvalTapScriptCheckSigFromStack(const valtype& sig, const valtype& vchPubKey, ScriptExecutionData& execdata, unsigned int flags, const valtype& msg, SigVersion sigversion, ScriptError* serror, bool& success) |
| 479 | { |
no test coverage detected