Changeset View
Changeset View
Standalone View
Standalone View
src/txdb.h
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | |||||
}; | }; | ||||
/** CCoinsView backed by the coin database (chainstate/) */ | /** CCoinsView backed by the coin database (chainstate/) */ | ||||
class CCoinsViewDB final : public CCoinsView { | class CCoinsViewDB final : public CCoinsView { | ||||
protected: | protected: | ||||
CDBWrapper db; | CDBWrapper db; | ||||
public: | public: | ||||
CCoinsViewDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); | explicit CCoinsViewDB(size_t nCacheSize, bool fMemory = false, | ||||
bool fWipe = false); | |||||
bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | bool GetCoin(const COutPoint &outpoint, Coin &coin) const override; | ||||
bool HaveCoin(const COutPoint &outpoint) const override; | bool HaveCoin(const COutPoint &outpoint) const override; | ||||
uint256 GetBestBlock() const override; | uint256 GetBestBlock() const override; | ||||
std::vector<uint256> GetHeadBlocks() const override; | std::vector<uint256> GetHeadBlocks() const override; | ||||
bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override; | bool BatchWrite(CCoinsMap &mapCoins, const uint256 &hashBlock) override; | ||||
CCoinsViewCursor *Cursor() const override; | CCoinsViewCursor *Cursor() const override; | ||||
Show All 22 Lines | private: | ||||
std::pair<char, COutPoint> keyTmp; | std::pair<char, COutPoint> keyTmp; | ||||
friend class CCoinsViewDB; | friend class CCoinsViewDB; | ||||
}; | }; | ||||
/** Access to the block database (blocks/index/) */ | /** Access to the block database (blocks/index/) */ | ||||
class CBlockTreeDB : public CDBWrapper { | class CBlockTreeDB : public CDBWrapper { | ||||
public: | public: | ||||
CBlockTreeDB(size_t nCacheSize, bool fMemory = false, bool fWipe = false); | explicit CBlockTreeDB(size_t nCacheSize, bool fMemory = false, | ||||
bool fWipe = false); | |||||
private: | private: | ||||
CBlockTreeDB(const CBlockTreeDB &); | CBlockTreeDB(const CBlockTreeDB &); | ||||
void operator=(const CBlockTreeDB &); | void operator=(const CBlockTreeDB &); | ||||
public: | public: | ||||
bool WriteBatchSync( | bool WriteBatchSync( | ||||
const std::vector<std::pair<int, const CBlockFileInfo *>> &fileInfo, | const std::vector<std::pair<int, const CBlockFileInfo *>> &fileInfo, | ||||
Show All 15 Lines |