53 std::unique_ptr<CDBWrapper>
m_db;
58 bool GetCoin(
const COutPoint &outpoint,
Coin &coin)
const override;
59 bool HaveCoin(
const COutPoint &outpoint)
const override;
83 bool GetKey(COutPoint &key)
const override;
87 bool Valid()
const override;
104 const std::vector<std::pair<int, const CBlockFileInfo *>> &fileInfo,
105 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 Upgrade()
Attempt to update from an older database format.
bool WriteReindexing(bool fReindexing)
bool IsReindexing() const
bool WriteBatchSync(const std::vector< std::pair< int, const CBlockFileInfo * > > &fileInfo, int nLastFile, const std::vector< const CBlockIndex * > &blockinfo)
bool LoadBlockIndexGuts(const Consensus::Params ¶ms, std::function< CBlockIndex *(const BlockHash &)> insertBlockIndex, const util::SignalInterrupt &interrupt) EXCLUSIVE_LOCKS_REQUIRED(
bool ReadFlag(const std::string &name, bool &fValue)
bool ReadLastBlockFile(int &nFile)
bool WriteFlag(const std::string &name, bool fValue)
Cursor for iterating over CoinsView state.
Specialization of CCoinsViewCursor to iterate over a CCoinsViewDB.
std::unique_ptr< CDBIterator > pcursor
bool GetKey(COutPoint &key) const override
~CCoinsViewDBCursor()=default
bool GetValue(Coin &coin) const override
bool Valid() const override
CCoinsViewDBCursor(CDBIterator *pcursorIn, const BlockHash &hashBlockIn)
unsigned int GetValueSize() const override
std::pair< char, COutPoint > keyTmp
CCoinsView backed by the coin database (chainstate/)
BlockHash GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
std::vector< BlockHash > GetHeadBlocks() const override
Retrieve the range of blocks that may have been only partially written.
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
CCoinsViewCursor * Cursor() const override
Get a cursor to iterate over the whole state.
CCoinsViewDB(DBParams db_params, CoinsViewOptions options)
bool BatchWrite(CoinsViewCacheCursor &cursor, const BlockHash &hashBlock) override
Do a bulk modification (multiple Coin changes + BestBlock change).
std::optional< fs::path > StoragePath()
void ResizeCache(size_t new_cache_size) EXCLUSIVE_LOCKS_REQUIRED(cs_main)
Dynamically alter the underlying leveldb cache size.
CoinsViewOptions m_options
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)
Helper class that manages an interrupt flag, and allows a thread or signal to interrupt another threa...
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static constexpr size_t DEFAULT_DB_CACHE_BATCH
Default LevelDB write batch size.
A BlockHash is a unqiue identifier for a block.
Cursor for iterating over the linked list of flagged entries in CCoinsViewCache.
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(...)
util::Result< void > CheckLegacyTxindex(CBlockTreeDB &block_tree_db)