diff options
Diffstat (limited to 'src/db.h')
-rw-r--r-- | src/db.h | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -102,6 +102,7 @@ protected: explicit CDB(const char* pszFile, const char* pszMode="r+"); ~CDB() { Close(); } public: + void Flush(); void Close(); private: CDB(const CDB&); @@ -330,6 +331,23 @@ public: bool WriteHashBestChain(uint256 hashBestChain); }; + +/** CCoinsView backed by a CCoinsDB */ +class CCoinsViewDB : public CCoinsView +{ +protected: + CCoinsDB db; +public: + CCoinsViewDB(); + bool GetCoins(uint256 txid, CCoins &coins); + bool SetCoins(uint256 txid, const CCoins &coins); + bool HaveCoins(uint256 txid); + CBlockIndex *GetBestBlock(); + bool SetBestBlock(CBlockIndex *pindex); + bool BatchWrite(const std::map<uint256, CCoins> &mapCoins, CBlockIndex *pindex); +}; + + /** Access to the block database (chain.dat) */ class CChainDB : public CDB { @@ -350,7 +368,7 @@ public: }; -bool LoadBlockIndex(CCoinsDB &coinsdb, CChainDB &chaindb); +bool LoadBlockIndex(CChainDB &chaindb); /** Access to the (IP) address database (peers.dat) */ |