| 2018 | } |
| 2019 | |
| 2020 | std::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 | |
| 2032 | ValidationCache::ValidationCache(const size_t script_execution_cache_bytes, const size_t signature_cache_bytes) |
| 2033 | : m_signature_cache{signature_cache_bytes} |
nothing calls this directly
no test coverage detected