Changeset View
Changeset View
Standalone View
Standalone View
src/validation.h
Show First 20 Lines • Show All 467 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* Check whether all inputs of this transaction are valid (no double spends, | * Check whether all inputs of this transaction are valid (no double spends, | ||||
* scripts & sigs, amounts). This does not modify the UTXO set. | * scripts & sigs, amounts). This does not modify the UTXO set. | ||||
* | * | ||||
* If pvChecks is not nullptr, script checks are pushed onto it instead of being | * If pvChecks is not nullptr, script checks are pushed onto it instead of being | ||||
* performed inline. Any script checks which are not necessary (eg due to script | * performed inline. Any script checks which are not necessary (eg due to script | ||||
* execution cache hits) are, obviously, not pushed onto pvChecks/run. | * execution cache hits) are, obviously, not pushed onto pvChecks/run. | ||||
* | * | ||||
* Upon success metricsOut will be filled in with either: | |||||
* - correct metrics total for all inputs, or, | |||||
* - empty metrics, in the case when checks were pushed onto pvChecks (i.e., | |||||
* a cache miss with pvChecks non-null), in which case the metrics can be | |||||
* found by executing the pushed pvChecks. | |||||
* | |||||
* Setting sigCacheStore/scriptCacheStore to false will remove elements from the | * Setting sigCacheStore/scriptCacheStore to false will remove elements from the | ||||
* corresponding cache which are matched. This is useful for checking blocks | * corresponding cache which are matched. This is useful for checking blocks | ||||
* where we will likely never need the cache entry again. | * where we will likely never need the cache entry again. | ||||
*/ | */ | ||||
bool CheckInputs(const CTransaction &tx, CValidationState &state, | bool CheckInputs(const CTransaction &tx, CValidationState &state, | ||||
const CCoinsViewCache &view, bool fScriptChecks, | const CCoinsViewCache &view, bool fScriptChecks, | ||||
const uint32_t flags, bool sigCacheStore, | const uint32_t flags, bool sigCacheStore, | ||||
bool scriptCacheStore, | bool scriptCacheStore, | ||||
const PrecomputedTransactionData &txdata, | const PrecomputedTransactionData &txdata, | ||||
ScriptExecutionMetrics &metricsOut, | |||||
std::vector<CScriptCheck> *pvChecks = nullptr) | std::vector<CScriptCheck> *pvChecks = nullptr) | ||||
EXCLUSIVE_LOCKS_REQUIRED(cs_main); | EXCLUSIVE_LOCKS_REQUIRED(cs_main); | ||||
/** | /** | ||||
* Mark all the coins corresponding to a given transaction inputs as spent. | * Mark all the coins corresponding to a given transaction inputs as spent. | ||||
*/ | */ | ||||
void SpendCoins(CCoinsViewCache &view, const CTransaction &tx, CTxUndo &txundo, | void SpendCoins(CCoinsViewCache &view, const CTransaction &tx, CTxUndo &txundo, | ||||
int nHeight); | int nHeight); | ||||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |