43 std::unique_ptr<CDBWrapper>
m_db;
55 std::unique_ptr<CCoinsViewCursor>
Cursor()
const override;
CCoinsView backed by the coin database (chainstate/)
Mutex m_db_mutex
Prevents CompactFull() from using m_db while ResizeCache() replaces it.
std::shared_future< void > CompactFullAsync() EXCLUSIVE_LOCKS_REQUIRED(cs_main
Perform a full compaction of the underlying LevelDB on a one-shot background thread.
std::shared_future< void > m_compaction
bool HaveCoin(const COutPoint &outpoint) const override
Just check whether a given outpoint is unspent.
std::unique_ptr< CDBWrapper > m_db
CCoinsViewDB(DBParams db_params, CoinsViewOptions options)
std::optional< std::string > GetDBProperty(const std::string &property)
Return an underlying LevelDB property value, if available.
std::optional< Coin > PeekCoin(const COutPoint &outpoint) const override
Retrieve the Coin (unspent transaction output) for a given outpoint, without caching results.
uint256 GetBestBlock() const override
Retrieve the block hash whose state this CCoinsView currently represents.
std::optional< Coin > GetCoin(const COutPoint &outpoint) const override
Retrieve the Coin (unspent transaction output) for a given outpoint.
void ResizeCache(size_t new_cache_size) EXCLUSIVE_LOCKS_REQUIRED(cs_main
Dynamically alter the underlying leveldb cache size.
std::unique_ptr< CCoinsViewCursor > Cursor() const override
Get a cursor to iterate over the whole state. Implementations may return nullptr.
CoinsViewOptions m_options
std::vector< uint256 > GetHeadBlocks() const override
Retrieve the range of blocks that may have been only partially written.
void BatchWrite(CoinsViewCacheCursor &cursor, const uint256 &block_hash) override
Do a bulk modification (multiple Coin changes + BestBlock change).
bool NeedsUpgrade()
Whether an unsupported database format is used.
size_t EstimateSize() const override
Estimate database size.
Pure abstract view on the open txout dataset.
An outpoint - a combination of a transaction hash and an index n into its vout.
RecursiveMutex cs_main
Mutex to guard access to validation specific variables, such as reading or changing the chainstate.
static constexpr uint64_t DEFAULT_DB_CACHE_BATCH
Default LevelDB write batch size.
Cursor for iterating over the linked list of flagged entries in CCoinsViewCache.
User-controlled performance and debug options.
uint64_t batch_write_bytes
Maximum database write batch size in bytes.
int simulate_crash_ratio
If non-zero, randomly exit when the database is flushed with (1/ratio) probability.
Application-specific storage settings.
#define EXCLUSIVE_LOCKS_REQUIRED(...)