aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2012-09-03 15:26:57 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2012-10-20 23:08:57 +0200
commitd979e6e36ac6be0d40b2a6bb70c668f9e6989ff9 (patch)
tree6ed14b062fb97de3c1b9646161297649825b62e4 /src/test
parent857c61df0b71c8a0482b1bf8fc55849f8ad831b8 (diff)
Use singleton block tree database instance
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_bitcoin.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/test/test_bitcoin.cpp b/src/test/test_bitcoin.cpp
index bcf0907871..4580877cd8 100644
--- a/src/test/test_bitcoin.cpp
+++ b/src/test/test_bitcoin.cpp
@@ -12,10 +12,15 @@ extern bool fPrintToConsole;
extern void noui_connect();
struct TestingSetup {
+ CCoinsViewDB *pcoinsdbview;
+
TestingSetup() {
fPrintToDebugger = true; // don't want to write to debug.log file
noui_connect();
bitdb.MakeMock();
+ pblocktree = new CBlockTreeDB("cr+");
+ pcoinsdbview = new CCoinsViewDB();
+ pcoinsTip = new CCoinsViewCache(*pcoinsdbview);
LoadBlockIndex(true);
bool fFirstRun;
pwalletMain = new CWallet("wallet.dat");
@@ -26,6 +31,9 @@ struct TestingSetup {
{
delete pwalletMain;
pwalletMain = NULL;
+ delete pcoinsTip;
+ delete pcoinsdbview;
+ delete pblocktree;
bitdb.Flush(true);
}
};