Bitcoin ABC 0.30.5
P2P Digital Currency
Classes | Functions | Variables
scriptcache.cpp File Reference
#include <script/scriptcache.h>
#include <common/system.h>
#include <crypto/sha256.h>
#include <cuckoocache.h>
#include <primitives/transaction.h>
#include <random.h>
#include <script/sigcache.h>
#include <sync.h>
#include <validation.h>
Include dependency graph for scriptcache.cpp:

Go to the source code of this file.

Classes

struct  ScriptCacheElement
 In future if many more values are added, it should be considered to expand the element size to 64 bytes (with padding the spare space as needed) so the key can be long. More...
 
class  ScriptCacheHasher
 

Functions

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

Variables

static CuckooCache::cache< ScriptCacheElement, ScriptCacheHasherg_scriptExecutionCache
 
static CSHA256 g_scriptExecutionCacheHasher
 

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

◆ g_scriptExecutionCache

CuckooCache::cache<ScriptCacheElement, ScriptCacheHasher> g_scriptExecutionCache
static

Definition at line 73 of file scriptcache.cpp.

◆ g_scriptExecutionCacheHasher

CSHA256 g_scriptExecutionCacheHasher
static

Definition at line 74 of file scriptcache.cpp.