Wipe llmq db on reindex (#2835)

This commit is contained in:
UdjinM6 2019-04-05 06:57:46 +03:00 committed by Alexander Block
parent 4af5ea8a7f
commit 0a6416e064
3 changed files with 4 additions and 4 deletions

View File

@ -1772,7 +1772,7 @@ bool AppInitMain(boost::thread_group& threadGroup, CScheduler& scheduler)
pcoinsdbview = new CCoinsViewDB(nCoinDBCache, false, fReindex || fReindexChainState);
pcoinscatcher = new CCoinsViewErrorCatcher(pcoinsdbview);
pcoinsTip = new CCoinsViewCache(pcoinscatcher);
llmq::InitLLMQSystem(*evoDb, &scheduler, false);
llmq::InitLLMQSystem(*evoDb, &scheduler, false, fReindex || fReindexChainState);
if (fReindex) {
pblocktree->WriteReindexing(true);

View File

@ -24,9 +24,9 @@ CBLSWorker* blsWorker;
CDBWrapper* llmqDb;
void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests)
void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests, bool fWipe)
{
llmqDb = new CDBWrapper(unitTests ? "" : (GetDataDir() / "llmq"), 1 << 20, unitTests);
llmqDb = new CDBWrapper(unitTests ? "" : (GetDataDir() / "llmq"), 1 << 20, unitTests, fWipe);
blsWorker = new CBLSWorker();
quorumDKGDebugManager = new CDKGDebugManager(scheduler);

View File

@ -18,7 +18,7 @@ static const bool DEFAULT_WATCH_QUORUMS = false;
extern CDBWrapper* llmqDb;
// Init/destroy LLMQ globals
void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests);
void InitLLMQSystem(CEvoDB& evoDb, CScheduler* scheduler, bool unitTests, bool fWipe = false);
void DestroyLLMQSystem();
// Manage scheduled tasks, threads, listeners etc.