38 static const int64_t
nMaxDbCache =
sizeof(
void*) > 4 ? 16384 : 1024;
67 std::unique_ptr<CDBWrapper>
m_db;
76 std::unique_ptr<CCoinsViewCursor>
Cursor()
const override;
94 bool WriteBatchSync(
const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo,
int nLastFile,
const std::vector<const CBlockIndex*>& blockinfo);
const CChainParams & Params()
Return the currently selected parameters.
The block chain is a tree shaped structure starting with the genesis block at the root,...
Access to the block database (blocks/index/)
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info)
bool WriteReindexing(bool fReindexing)
void ReadReindexing(bool &fReindexing)
bool WriteBatchSync(const std::vector< std::pair< int, const CBlockFileInfo * > > &fileInfo, int nLastFile, const std::vector< const CBlockIndex * > &blockinfo)
bool ReadFlag(const std::string &name, bool &fValue)
bool ReadLastBlockFile(int &nFile)
bool WriteFlag(const std::string &name, bool fValue)
CCoinsView backed by the coin database (chainstate/)
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override
Retrieve the Coin (unspent transaction output) for a given outpoint.
bool HaveCoin(const COutPoint &outpoint) const override
Just check whether a given outpoint is unspent.
std::unique_ptr< CDBWrapper > m_db
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock, bool erase=true) override
Do a bulk modification (multiple Coin changes + BestBlock change).
std::optional< fs::path > StoragePath()
CCoinsViewDB(DBParams db_params, CoinsViewOptions options)
uint256 GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
std::unique_ptr< CCoinsViewCursor > Cursor() const override
Get a cursor to iterate over the whole state.
void ResizeCache(size_t new_cache_size) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Dynamically alter the underlying leveldb cache size.
CoinsViewOptions m_options
std::vector< uint256 > GetHeadBlocks() const override
Retrieve the range of blocks that may have been only partially written.
bool NeedsUpgrade()
Whether an unsupported database format is used.
size_t EstimateSize() const override
Estimate database size (0 if not implemented)
Abstract view on the open txout dataset.
CDBWrapper(const DBParams ¶ms)
An outpoint - a combination of a transaction hash and an index n into its vout.
std::unordered_map< COutPoint, CCoinsCacheEntry, SaltedOutpointHasher, std::equal_to< COutPoint >, PoolAllocator< std::pair< const COutPoint, CCoinsCacheEntry >, sizeof(std::pair< const COutPoint, CCoinsCacheEntry >)+sizeof(void *) *4, alignof(void *)> > CCoinsMap
PoolAllocator's MAX_BLOCK_SIZE_BYTES parameter here uses sizeof the data, and adds the size of 4 poin...
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
Transaction validation functions.
User-controlled performance and debug options.
int simulate_crash_ratio
If non-zero, randomly exit when the database is flushed with (1/ratio) probability.
size_t batch_write_bytes
Maximum database write batch size in bytes.
Parameters that influence chain consensus.
Application-specific storage settings.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
static const int64_t nMinDbCache
min. -dbcache (MiB)
static const int64_t nDefaultDbBatchSize
-dbbatchsize default (bytes)
static const int64_t nMaxCoinsDBCache
Max memory allocated to coin DB specific cache (MiB)
static const int64_t nMaxBlockDBCache
Max memory allocated to block tree DB specific cache, if no -txindex (MiB)
util::Result< void > CheckLegacyTxindex(CBlockTreeDB &block_tree_db)
static const int64_t nMaxTxIndexCache
Max memory allocated to block tree DB specific cache, if -txindex (MiB)
static const int64_t nMaxDbCache
max. -dbcache (MiB)
static const int64_t nDefaultDbCache
-dbcache default (MiB)
static const int64_t max_filter_index_cache
Max memory allocated to all block filter index caches combined in MiB.