mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Add LevelDB MemEnv support
Support LevelDB memory-backed environments, and use them in unit tests.
This commit is contained in:
parent
2d8a48292b
commit
e1bfbab802
8 changed files with 27 additions and 12 deletions
|
|
@ -2,6 +2,7 @@
|
|||
#include <boost/test/unit_test.hpp>
|
||||
|
||||
#include "db.h"
|
||||
#include "txdb.h"
|
||||
#include "main.h"
|
||||
#include "wallet.h"
|
||||
|
||||
|
|
@ -18,8 +19,13 @@ struct TestingSetup {
|
|||
fPrintToDebugger = true; // don't want to write to debug.log file
|
||||
noui_connect();
|
||||
bitdb.MakeMock();
|
||||
pblocktree = new CBlockTreeDB("cr+");
|
||||
#ifdef USE_LEVELDB
|
||||
pblocktree = new CBlockTreeDB(true);
|
||||
pcoinsdbview = new CCoinsViewDB(true);
|
||||
#else
|
||||
pblocktree = new CBlockTreeDB();
|
||||
pcoinsdbview = new CCoinsViewDB();
|
||||
#endif
|
||||
pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
|
||||
LoadBlockIndex(true);
|
||||
bool fFirstRun;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue