Skip to content

Commit

Permalink
fix: Start LLMQContext early to let VerifyDB() check ChainLock sign…
Browse files Browse the repository at this point in the history
…atures in coinbase
  • Loading branch information
UdjinM6 committed Dec 4, 2023
1 parent eb3f601 commit fde2f6b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1930,8 +1930,14 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
creditPoolManager.reset(new CCreditPoolManager(*node.evodb));
llmq::quorumSnapshotManager.reset();
llmq::quorumSnapshotManager.reset(new llmq::CQuorumSnapshotManager(*node.evodb));

if (node.llmq_ctx) {
node.llmq_ctx->Stop();
}
node.llmq_ctx.reset();
node.llmq_ctx.reset(new LLMQContext(chainman.ActiveChainstate(), *node.connman, *node.evodb, *::sporkManager, *node.mempool, node.peerman, false, fReset || fReindexChainState));
// Have to start it early to let VerifyDB check ChainLock signatures in coinbase
node.llmq_ctx->Start();

if (fReset) {
pblocktree->WriteReindexing(true);
Expand Down Expand Up @@ -2298,8 +2304,6 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc
node.scheduler->scheduleEvery(std::bind(&PeriodicStats, std::ref(*node.args), std::cref(*node.mempool)), std::chrono::seconds{nStatsPeriod});
}

node.llmq_ctx->Start();

// ********************************************************* Step 11: import blocks

if (!CheckDiskSpace(GetDataDir())) {
Expand Down

0 comments on commit fde2f6b

Please sign in to comment.