diff --git a/src/init.cpp b/src/init.cpp index 39b80605e8ba5..88ca19588d5d6 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1938,7 +1938,7 @@ bool AppInitMain(const CoreContext& context, NodeContext& node, interfaces::Bloc llmq::quorumSnapshotManager.reset(); llmq::quorumSnapshotManager.reset(new llmq::CQuorumSnapshotManager(*node.evodb)); node.llmq_ctx.reset(); - node.llmq_ctx.reset(new LLMQContext(chainman.ActiveChainstate(), *node.connman, *node.evodb, *::sporkManager, *node.mnhf_manager, *node.mempool, node.peerman, false, fReset || fReindexChainState)); + node.llmq_ctx.reset(new LLMQContext(chainman.ActiveChainstate(), *node.connman, *node.evodb, *::sporkManager, *node.mempool, node.peerman, false, fReset || fReindexChainState)); if (fReset) { pblocktree->WriteReindexing(true); diff --git a/src/llmq/context.cpp b/src/llmq/context.cpp index 209941c601abe..2162f36ed3669 100644 --- a/src/llmq/context.cpp +++ b/src/llmq/context.cpp @@ -20,7 +20,7 @@ #include #include -LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman, CMNHFManager& mnhfman, CTxMemPool& mempool, +LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman, CTxMemPool& mempool, const std::unique_ptr& peerman, bool unit_tests, bool wipe) : bls_worker{std::make_shared()}, dkg_debugman{std::make_unique()}, @@ -47,7 +47,7 @@ LLMQContext::LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo llmq::quorumInstantSendManager = std::make_unique(*llmq::chainLocksHandler, chainstate, connman, *llmq::quorumManager, *sigman, *shareman, sporkman, mempool, *::masternodeSync, peerman, unit_tests, wipe); return llmq::quorumInstantSendManager.get(); }()}, - ehfSignalsHandler{std::make_unique(chainstate, connman, *sigman, *shareman, sporkman, *llmq::quorumManager, mempool, mnhfman)} + ehfSignalsHandler{std::make_unique(chainstate, connman, *sigman, *shareman, sporkman, *llmq::quorumManager, mempool)} { // NOTE: we use this only to wipe the old db, do NOT use it for anything else // TODO: remove it in some future version diff --git a/src/llmq/context.h b/src/llmq/context.h index f29df912f9de4..10747651dd85e 100644 --- a/src/llmq/context.h +++ b/src/llmq/context.h @@ -12,7 +12,6 @@ class CChainState; class CConnman; class CDBWrapper; class CEvoDB; -class CMNHFManager; class CSporkManager; class CTxMemPool; class PeerManager; @@ -33,7 +32,7 @@ struct LLMQContext { LLMQContext() = delete; LLMQContext(const LLMQContext&) = delete; LLMQContext(CChainState& chainstate, CConnman& connman, CEvoDB& evo_db, CSporkManager& sporkman, - CMNHFManager& mnhfman, CTxMemPool& mempool, + CTxMemPool& mempool, const std::unique_ptr& peerman, bool unit_tests, bool wipe); ~LLMQContext(); diff --git a/src/llmq/ehf_signals.cpp b/src/llmq/ehf_signals.cpp index e1ef798096ec6..2274032e3c5e9 100644 --- a/src/llmq/ehf_signals.cpp +++ b/src/llmq/ehf_signals.cpp @@ -24,16 +24,14 @@ namespace llmq { CEHFSignalsHandler::CEHFSignalsHandler(CChainState& chainstate, CConnman& connman, CSigningManager& sigman, CSigSharesManager& shareman, - CSporkManager& sporkman, CQuorumManager& qman, CTxMemPool& mempool, - CMNHFManager& mnhfManager) : + const CSporkManager& sporkman, const CQuorumManager& qman, CTxMemPool& mempool) : chainstate(chainstate), connman(connman), sigman(sigman), shareman(shareman), sporkman(sporkman), qman(qman), - mempool(mempool), - mnhfManager(mnhfManager) + mempool(mempool) { sigman.RegisterRecoveredSigsListener(this); } diff --git a/src/llmq/ehf_signals.h b/src/llmq/ehf_signals.h index 32a3174d9a24f..91e0d9ac05992 100644 --- a/src/llmq/ehf_signals.h +++ b/src/llmq/ehf_signals.h @@ -12,7 +12,6 @@ class CBlockIndex; class CChainState; class CConnman; -class CMNHFManager; class CSporkManager; class CTxMemPool; @@ -29,10 +28,9 @@ class CEHFSignalsHandler : public CRecoveredSigsListener CConnman& connman; CSigningManager& sigman; CSigSharesManager& shareman; - CSporkManager& sporkman; - CQuorumManager& qman; + const CSporkManager& sporkman; + const CQuorumManager& qman; CTxMemPool& mempool; - CMNHFManager& mnhfManager; /** * keep freshly generated IDs for easier filter sigs in HandleNewRecoveredSig @@ -42,8 +40,7 @@ class CEHFSignalsHandler : public CRecoveredSigsListener public: explicit CEHFSignalsHandler(CChainState& chainstate, CConnman& connman, CSigningManager& sigman, CSigSharesManager& shareman, - CSporkManager& sporkman, CQuorumManager& qman, CTxMemPool& mempool, - CMNHFManager& mnhfManager); + const CSporkManager& sporkman, const CQuorumManager& qman, CTxMemPool& mempool); ~CEHFSignalsHandler(); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index 1e33da979710c..c077f7bd7f348 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -110,7 +110,7 @@ void DashTestSetup(NodeContext& node) node.cj_ctx = std::make_unique(chainstate, *node.connman, *node.mempool, *::masternodeSync, /* relay_txes */ true); ::deterministicMNManager = std::make_unique(chainstate, *node.connman, *node.evodb); - node.llmq_ctx = std::make_unique(chainstate, *node.connman, *node.evodb, *sporkManager, *node.mnhf_manager, *node.mempool, node.peerman, true, false); + node.llmq_ctx = std::make_unique(chainstate, *node.connman, *node.evodb, *sporkManager, *node.mempool, node.peerman, true, false); } void DashTestSetupClose(NodeContext& node)