diff --git a/src/init.cpp b/src/init.cpp index 1abb710513..7eb9992f34 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1906,8 +1906,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) *node.mempool, node.mn_activeman.get(), *node.mn_sync, node.peerman, /* unit_tests = */ false, /* wipe = */ fReset || fReindexChainState); // Enable CMNHFManager::{Process, Undo}Block node.mnhf_manager->ConnectManagers(node.chainman.get(), node.llmq_ctx->qman.get()); - // Have to start it early to let VerifyDB check ChainLock signatures in coinbase - node.llmq_ctx->Start(); node.chain_helper.reset(); node.chain_helper = std::make_unique(*node.cpoolman, *node.dmnman, *node.mnhf_manager, *node.govman, *(node.llmq_ctx->quorum_block_processor), *node.chainman, @@ -2282,6 +2280,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) // ********************************************************* Step 10a: schedule Dash-specific tasks + node.llmq_ctx->Start(); + node.scheduler->scheduleEvery(std::bind(&CNetFulfilledRequestManager::DoMaintenance, std::ref(*node.netfulfilledman)), std::chrono::minutes{1}); node.scheduler->scheduleEvery(std::bind(&CMasternodeSync::DoMaintenance, std::ref(*node.mn_sync), std::cref(*node.peerman), std::cref(*node.govman)), std::chrono::seconds{1}); node.scheduler->scheduleEvery(std::bind(&CMasternodeUtils::DoMaintenance, std::ref(*node.connman), std::ref(*node.dmnman), std::ref(*node.mn_sync), std::ref(*node.cj_ctx)), std::chrono::minutes{1}); diff --git a/src/llmq/context.cpp b/src/llmq/context.cpp index 2d58262f80..80c321f332 100644 --- a/src/llmq/context.cpp +++ b/src/llmq/context.cpp @@ -54,9 +54,13 @@ LLMQContext::LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterm }()}, ehfSignalsHandler{std::make_unique(chainman, mnhfman, *sigman, *shareman, *qman)} { + // Have to start it early to let VerifyDB check ChainLock signatures in coinbase + bls_worker->Start(); } LLMQContext::~LLMQContext() { + bls_worker->Stop(); + // LLMQContext doesn't own these objects, but still need to care of them for consistency: llmq::quorumInstantSendManager.reset(); llmq::chainLocksHandler.reset(); @@ -74,7 +78,6 @@ void LLMQContext::Start() { assert(clhandler == llmq::chainLocksHandler.get()); assert(isman == llmq::quorumInstantSendManager.get()); - bls_worker->Start(); if (is_masternode) { qdkgsman->StartThreads(); } @@ -101,5 +104,4 @@ void LLMQContext::Stop() { if (is_masternode) { qdkgsman->StopThreads(); } - bls_worker->Stop(); }