51 explicit CCoinsViewDB(
size_t nCacheSize,
bool fMemory =
false,
bool fWipe =
false);
75 bool Valid()
const override;
91 explicit CBlockTreeDB(
size_t nCacheSize,
bool fMemory =
false,
bool fWipe =
false);
93 bool WriteBatchSync(
const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo,
int nLastFile,
const std::vector<const CBlockIndex*>& blockinfo);
103 #endif // BITCOIN_TXDB_H bool HaveCoin(const COutPoint &outpoint) const override
Just check whether a given outpoint is unspent.
Definition: txdb.cpp:62
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &info)
Definition: txdb.cpp:150
static const int64_t nMaxTxIndexCache
Max memory allocated to block tree DB specific cache, if -txindex (MiB)
Definition: txdb.h:39
Definition: dbwrapper.h:117
CBlockTreeDB(size_t nCacheSize, bool fMemory=false, bool fWipe=false)
Definition: txdb.cpp:147
uint256 GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
Definition: txdb.cpp:66
CDBWrapper db
Definition: txdb.h:49
std::pair< char, COutPoint > keyTmp
Definition: txdb.h:82
static const int64_t nMinDbCache
min. -dbcache (MiB)
Definition: txdb.h:33
bool GetKey(COutPoint &key) const override
Definition: txdb.cpp:187
static const int64_t max_filter_index_cache
Max memory allocated to all block filter index caches combined in MiB.
Definition: txdb.h:41
bool WriteFlag(const std::string &name, bool fValue)
Definition: txdb.cpp:235
CCoinsViewDBCursor(CDBIterator *pcursorIn, const uint256 &hashBlockIn)
Definition: txdb.h:79
static constexpr int MAX_BLOCK_COINSDB_USAGE
No need to periodic flush if at least this much space still available.
Definition: txdb.h:25
bool Upgrade()
Attempt to update from an older database format. Returns whether an error occurred.
Definition: txdb.cpp:350
size_t EstimateSize() const override
Estimate database size (0 if not implemented)
Definition: txdb.cpp:142
CCoinsViewCursor * Cursor() const override
Get a cursor to iterate over the whole state.
Definition: txdb.cpp:169
bool WriteBatchSync(const std::vector< std::pair< int, const CBlockFileInfo * > > &fileInfo, int nLastFile, const std::vector< const CBlockIndex * > &blockinfo)
Definition: txdb.cpp:223
void Next() override
Definition: txdb.cpp:212
Definition: transaction.h:18
void ReadReindexing(bool &fReindexing)
Definition: txdb.cpp:161
const char * name
Definition: rest.cpp:39
std::unordered_map< COutPoint, CCoinsCacheEntry, SaltedOutpointHasher > CCoinsMap
Definition: coins.h:122
bool LoadBlockIndexGuts(const Consensus::Params &consensusParams, std::function< CBlockIndex *(const uint256 &)> insertBlockIndex)
Definition: txdb.cpp:247
bool WriteReindexing(bool fReindexing)
Definition: txdb.cpp:154
bool GetValue(Coin &coin) const override
Definition: txdb.cpp:197
static const int64_t nDefaultDbCache
-dbcache default (MiB)
Definition: txdb.h:27
static const int64_t nDefaultDbBatchSize
-dbbatchsize default (bytes)
Definition: txdb.h:29
CCoinsViewDB(size_t nCacheSize, bool fMemory=false, bool fWipe=false)
Definition: txdb.cpp:54
static const int64_t nMaxBlockDBCache
Max memory allocated to block tree DB specific cache, if no -txindex (MiB)
Definition: txdb.h:35
Definition: uint256.h:121
std::vector< uint256 > GetHeadBlocks() const override
Definition: txdb.cpp:73
Definition: dbwrapper.h:176
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override
Definition: txdb.cpp:58
static const int64_t nMaxCoinsDBCache
Max memory allocated to coin DB specific cache (MiB)
Definition: txdb.h:43
static const int64_t nMaxDbCache
max. -dbcache (MiB)
Definition: txdb.h:31
bool ReadLastBlockFile(int &nFile)
Definition: txdb.cpp:165
unsigned int GetValueSize() const override
Definition: txdb.cpp:202
signed long long int64_t
Definition: stdint.h:18
bool ReadFlag(const std::string &name, bool &fValue)
Definition: txdb.cpp:239
std::unique_ptr< CDBIterator > pcursor
Definition: txdb.h:81
bool Valid() const override
Definition: txdb.cpp:207
~CCoinsViewDBCursor()
Definition: txdb.h:69
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override
Definition: txdb.cpp:81