 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
28 static const int64_t
nMaxDbCache =
sizeof(
void*) > 4 ? 16384 : 1024;
49 std::unique_ptr<CDBWrapper>
m_db;
56 explicit CCoinsViewDB(fs::path ldb_path,
size_t nCacheSize,
bool fMemory,
bool fWipe);
83 bool Valid()
const override;
99 explicit CBlockTreeDB(
size_t nCacheSize,
bool fMemory =
false,
bool fWipe =
false);
101 bool WriteBatchSync(
const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo,
int nLastFile,
const std::vector<const CBlockIndex*>& blockinfo);
111 #endif // BITCOIN_TXDB_H
CCoinsViewCursor * Cursor() const override
Get a cursor to iterate over the whole state.
bool Upgrade()
Attempt to update from an older database format. Returns whether an error occurred.
CCoinsView backed by the coin database (chainstate/)
CCoinsViewDBCursor(CDBIterator *pcursorIn, const uint256 &hashBlockIn)
static const int64_t nMaxDbCache
max. -dbcache (MiB)
bool GetKey(COutPoint &key) const override
CCoinsViewDB(fs::path ldb_path, size_t nCacheSize, bool fMemory, bool fWipe)
void ReadReindexing(bool &fReindexing)
Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB.
static const int64_t nMaxTxIndexCache
Max memory allocated to block tree DB specific cache, if -txindex (MiB)
static const int64_t nDefaultDbCache
-dbcache default (MiB)
static const int64_t nDefaultDbBatchSize
-dbbatchsize default (bytes)
Abstract view on the open txout dataset.
Cursor for iterating over CoinsView state.
Parameters that influence chain consensus.
void ResizeCache(size_t new_cache_size) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Dynamically alter the underlying leveldb cache size.
static const int64_t nMinDbCache
min. -dbcache (MiB)
unsigned int GetValueSize() const override
bool WriteBatchSync(const std::vector< std::pair< int, const CBlockFileInfo * > > &fileInfo, int nLastFile, const std::vector< const CBlockIndex * > &blockinfo)
size_t EstimateSize() const override
Estimate database size (0 if not implemented)
static const int64_t max_filter_index_cache
Max memory allocated to all block filter index caches combined in MiB.
bool HaveCoin(const COutPoint &outpoint) const override
Just check whether a given outpoint is unspent.
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info)
bool WriteReindexing(bool fReindexing)
static const int64_t nMaxCoinsDBCache
Max memory allocated to coin DB specific cache (MiB)
bool Valid() const override
Access to the block database (blocks/index/)
bool GetValue(Coin &coin) const override
bool ReadFlag(const std::string &name, bool &fValue)
bool WriteFlag(const std::string &name, bool fValue)
bool LoadBlockIndexGuts(const Consensus::Params &consensusParams, std::function< CBlockIndex *(const uint256 &)> insertBlockIndex)
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override
Do a bulk modification (multiple Coin changes + BestBlock change).
std::pair< char, COutPoint > keyTmp
uint256 GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
std::unordered_map< COutPoint, CCoinsCacheEntry, SaltedOutpointHasher > CCoinsMap
CBlockTreeDB(size_t nCacheSize, bool fMemory=false, bool fWipe=false)
An outpoint - a combination of a transaction hash and an index n into its vout.
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override
Retrieve the Coin (unspent transaction output) for a given outpoint.
static const int64_t nMaxBlockDBCache
Max memory allocated to block tree DB specific cache, if no -txindex (MiB)
The block chain is a tree shaped structure starting with the genesis block at the root,...
std::unique_ptr< CDBIterator > pcursor
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
std::unique_ptr< CDBWrapper > m_db
std::vector< uint256 > GetHeadBlocks() const override
Retrieve the range of blocks that may have been only partially written.
bool ReadLastBlockFile(int &nFile)