MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / operator()

Method operator()

src/validation.cpp:2020–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2018}
2019
2020std::optional<std::pair<ScriptError, std::string>> CScriptCheck::operator()() {
2021 const CScript &scriptSig = ptxTo->vin[nIn].scriptSig;
2022 const CScriptWitness *witness = &ptxTo->vin[nIn].scriptWitness;
2023 ScriptError error{SCRIPT_ERR_UNKNOWN_ERROR};
2024 if (VerifyScript(scriptSig, m_tx_out.scriptPubKey, witness, m_flags, CachingTransactionSignatureChecker(ptxTo, nIn, m_tx_out.nValue, cacheStore, *m_signature_cache, *txdata), &error)) {
2025 return std::nullopt;
2026 } else {
2027 auto debug_str = strprintf("input %i of %s (wtxid %s), spending %s:%i", nIn, ptxTo->GetHash().ToString(), ptxTo->GetWitnessHash().ToString(), ptxTo->vin[nIn].prevout.hash.ToString(), ptxTo->vin[nIn].prevout.n);
2028 return std::make_pair(error, std::move(debug_str));
2029 }
2030}
2031
2032ValidationCache::ValidationCache(const size_t script_execution_cache_bytes, const size_t signature_cache_bytes)
2033 : m_signature_cache{signature_cache_bytes}

Callers

nothing calls this directly

Calls 4

VerifyScriptFunction · 0.85
ToStringMethod · 0.45
GetHashMethod · 0.45

Tested by

no test coverage detected