Add LevelDB MemEnv support

Support LevelDB memory-backed environments, and use them in unit tests.
This commit is contained in:
Pieter Wuille
2012-09-04 18:12:00 +02:00
parent 2d8a48292b
commit e1bfbab802
8 changed files with 27 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ class CCoinsViewDB : public CCoinsView
protected:
CLevelDB db;
public:
CCoinsViewDB();
CCoinsViewDB(bool fMemory = false);
bool GetCoins(uint256 txid, CCoins &coins);
bool SetCoins(uint256 txid, const CCoins &coins);
@@ -28,7 +28,7 @@ public:
class CBlockTreeDB : public CLevelDB
{
public:
CBlockTreeDB(const char* pszMode="r+") : CLevelDB(GetDataDir() / "blktree") { }
CBlockTreeDB(bool fMemory = false);
private:
CBlockTreeDB(const CBlockTreeDB&);
void operator=(const CBlockTreeDB&);