Changeset View
Changeset View
Standalone View
Standalone View
src/script/scriptcache.cpp
// Copyright (c) 2017 The Bitcoin developers | // Copyright (c) 2017 The Bitcoin developers | ||||
// Distributed under the MIT software license, see the accompanying | // Distributed under the MIT software license, see the accompanying | ||||
// file COPYING or http://www.opensource.org/licenses/mit-license.php. | // file COPYING or http://www.opensource.org/licenses/mit-license.php. | ||||
#include "scriptcache.h" | #include <script/scriptcache.h> | ||||
#include "crypto/sha256.h" | #include <crypto/sha256.h> | ||||
#include "cuckoocache.h" | #include <cuckoocache.h> | ||||
#include "primitives/transaction.h" | #include <primitives/transaction.h> | ||||
#include "random.h" | #include <random.h> | ||||
#include "script/sigcache.h" | #include <script/sigcache.h> | ||||
#include "sync.h" | #include <sync.h> | ||||
#include "util.h" | #include <util.h> | ||||
#include "validation.h" | #include <validation.h> | ||||
static CuckooCache::cache<uint256, SignatureCacheHasher> scriptExecutionCache; | static CuckooCache::cache<uint256, SignatureCacheHasher> scriptExecutionCache; | ||||
static uint256 scriptExecutionCacheNonce(GetRandHash()); | static uint256 scriptExecutionCacheNonce(GetRandHash()); | ||||
void InitScriptExecutionCache() { | void InitScriptExecutionCache() { | ||||
// nMaxCacheSize is unsigned. If -maxscriptcachesize is set to zero, | // nMaxCacheSize is unsigned. If -maxscriptcachesize is set to zero, | ||||
// setup_bytes creates the minimum possible cache (2 elements). | // setup_bytes creates the minimum possible cache (2 elements). | ||||
size_t nMaxCacheSize = | size_t nMaxCacheSize = | ||||
Show All 39 Lines |