Bitcoin ABC 0.30.5
P2P Digital Currency
Classes | Functions | Variables
scriptcache.h File Reference
#include <array>
#include <cstdint>
#include <kernel/cs_main.h>
#include <sync.h>
Include dependency graph for scriptcache.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  ScriptCacheKey
 The script cache is a map using a key/value element, that caches the success of executing a specific transaction's input scripts under a specific set of flags, along with any associated information learned during execution. More...
 

Functions

bool InitScriptExecutionCache (size_t max_size_bytes)
 Initializes the script-execution cache. More...
 
bool IsKeyInScriptCache (ScriptCacheKey key, bool erase, int &nSigChecksOut) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Check if a given key is in the cache, and if so, return its values. More...
 
void AddKeyInScriptCache (ScriptCacheKey key, int nSigChecks) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
 Add an entry in the cache. More...
 

Variables

static constexpr size_t DEFAULT_MAX_SCRIPT_CACHE_BYTES {32 << 20}
 

Function Documentation

◆ AddKeyInScriptCache()

void AddKeyInScriptCache ( ScriptCacheKey  key,
int  nSigChecks 
)

Add an entry in the cache.

Definition at line 119 of file scriptcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitScriptExecutionCache()

bool InitScriptExecutionCache ( size_t  max_size_bytes)

Initializes the script-execution cache.

Definition at line 76 of file scriptcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsKeyInScriptCache()

bool IsKeyInScriptCache ( ScriptCacheKey  key,
bool  erase,
int &  nSigChecksOut 
)

Check if a given key is in the cache, and if so, return its values.

(if not found, nSigChecks may or may not be set to an arbitrary value)

Definition at line 108 of file scriptcache.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ DEFAULT_MAX_SCRIPT_CACHE_BYTES

constexpr size_t DEFAULT_MAX_SCRIPT_CACHE_BYTES {32 << 20}
staticconstexpr

Definition at line 45 of file scriptcache.h.