Skip to content

Commit

Permalink
Wipe llmq db on reindex (#2835)
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 authored and codablock committed Apr 5, 2019
1 parent 4af5ea8 commit 0a6416e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/llmq/quorums_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/llmq/quorums_init.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 0a6416e

Please sign in to comment.