Skip to content

Commit 9574675

Browse files
JaredTateclaude
andcommitted
Fix build: restore CoinsViews and CoinsCacheSizeState in validation.h
Added missing CoinsViews class and CoinsCacheSizeState enum that were accidentally removed during duplicate cleanup. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 089f75e commit 9574675

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

src/validation.h

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,41 @@ class BlockManager
533533
}
534534
};
535535

536+
class CoinsViews {
537+
538+
public:
539+
//! The lowest level of the CoinsViews cache hierarchy sits in a leveldb database on disk.
540+
//! All unspent coins reside in this store.
541+
CCoinsViewDB m_dbview GUARDED_BY(cs_main);
542+
543+
//! This view wraps access to the leveldb instance and handles read errors gracefully.
544+
CCoinsViewErrorCatcher m_catcherview GUARDED_BY(cs_main);
545+
546+
//! This is the top layer of the cache hierarchy - it keeps as many coins in memory as
547+
//! can fit per the dbcache setting.
548+
std::unique_ptr<CCoinsViewCache> m_cacheview GUARDED_BY(cs_main);
549+
550+
//! This constructor initializes CCoinsViewDB and CCoinsViewErrorCatcher instances, but it
551+
//! *does not* create a CCoinsViewCache instance by default. This is done separately because the
552+
//! presence of the cache has implications on whether or not we're allowed to flush the cache's
553+
//! state to disk, which should not be done until the health of the database is verified.
554+
//!
555+
//! All arguments forwarded onto CCoinsViewDB.
556+
CoinsViews(DBParams db_params, CoinsViewOptions options);
557+
558+
//! Initialize the CCoinsViewCache member.
559+
void InitCache() EXCLUSIVE_LOCKS_REQUIRED(::cs_main);
560+
};
561+
562+
enum class CoinsCacheSizeState
563+
{
564+
//! The coins cache is in immediate need of a flush.
565+
CRITICAL = 2,
566+
//! The cache is at >= 90% capacity.
567+
LARGE = 1,
568+
OK = 0
569+
};
570+
536571

537572
/**
538573
* CChainState stores and provides an API to update our local knowledge of the

0 commit comments

Comments
 (0)