mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 07:28:59 +01:00
Use singleton block tree database instance
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user