aboutsummaryrefslogtreecommitdiff
path: root/src/db.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/db.h')
-rw-r--r--src/db.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/db.h b/src/db.h
index dd8993d56d..bdab635468 100644
--- a/src/db.h
+++ b/src/db.h
@@ -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) */