Skip to content

Commit a14e604

Browse files
committed
refactor: remove CConnman, PeerManager from LLMQContext ctor
1 parent d9e5cc7 commit a14e604

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/init.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1902,8 +1902,8 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
19021902
node.llmq_ctx->Stop();
19031903
}
19041904
node.llmq_ctx.reset();
1905-
node.llmq_ctx = std::make_unique<LLMQContext>(chainman, *node.connman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman,
1906-
*node.mempool, node.mn_activeman.get(), *node.mn_sync, node.peerman, /* unit_tests = */ false, /* wipe = */ fReset || fReindexChainState);
1905+
node.llmq_ctx = std::make_unique<LLMQContext>(chainman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman,
1906+
*node.mempool, node.mn_activeman.get(), *node.mn_sync, /*unit_tests=*/false, /*wipe=*/fReset || fReindexChainState);
19071907
// Enable CMNHFManager::{Process, Undo}Block
19081908
node.mnhf_manager->ConnectManagers(node.chainman.get(), node.llmq_ctx->qman.get());
19091909

src/llmq/context.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
#include <llmq/signing.h>
1919
#include <llmq/signing_shares.h>
2020

21-
LLMQContext::LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman,
22-
CEvoDB& evo_db, CMasternodeMetaMan& mn_metaman, CMNHFManager& mnhfman, CSporkManager& sporkman,
21+
LLMQContext::LLMQContext(ChainstateManager& chainman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
22+
CMasternodeMetaMan& mn_metaman, CMNHFManager& mnhfman, CSporkManager& sporkman,
2323
CTxMemPool& mempool, const CActiveMasternodeManager* const mn_activeman,
24-
const CMasternodeSync& mn_sync, const std::unique_ptr<PeerManager>& peerman, bool unit_tests,
25-
bool wipe) :
24+
const CMasternodeSync& mn_sync, bool unit_tests, bool wipe) :
2625
is_masternode{mn_activeman != nullptr},
2726
bls_worker{std::make_shared<CBLSWorker>()},
2827
dkg_debugman{std::make_unique<llmq::CDKGDebugManager>()},

src/llmq/context.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ struct LLMQContext {
3939
public:
4040
LLMQContext() = delete;
4141
LLMQContext(const LLMQContext&) = delete;
42-
LLMQContext(ChainstateManager& chainman, CConnman& connman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
42+
LLMQContext(ChainstateManager& chainman, CDeterministicMNManager& dmnman, CEvoDB& evo_db,
4343
CMasternodeMetaMan& mn_metaman, CMNHFManager& mnhfman, CSporkManager& sporkman, CTxMemPool& mempool,
44-
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync,
45-
const std::unique_ptr<PeerManager>& peerman, bool unit_tests, bool wipe);
44+
const CActiveMasternodeManager* const mn_activeman, const CMasternodeSync& mn_sync, bool unit_tests,
45+
bool wipe);
4646
~LLMQContext();
4747

4848
void Interrupt();

src/test/util/setup_common.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,12 @@ void DashTestSetup(NodeContext& node, const CChainParams& chainparams)
111111
node.mempool->ConnectManagers(node.dmnman.get());
112112

113113
node.cj_ctx = std::make_unique<CJContext>(*node.chainman, *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,
114-
/* mn_activeman = */ nullptr, *node.mn_sync, node.peerman, /* relay_txes = */ true);
114+
/*mn_activeman=*/nullptr, *node.mn_sync, node.peerman, /*relay_txes=*/true);
115115
#ifdef ENABLE_WALLET
116116
node.coinjoin_loader = interfaces::MakeCoinJoinLoader(*node.cj_ctx->walletman);
117117
#endif // ENABLE_WALLET
118-
node.llmq_ctx = std::make_unique<LLMQContext>(*node.chainman, *node.connman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman, *node.mempool,
119-
/* mn_activeman = */ nullptr, *node.mn_sync, node.peerman, /* unit_tests = */ true, /* wipe = */ false);
118+
node.llmq_ctx = std::make_unique<LLMQContext>(*node.chainman, *node.dmnman, *node.evodb, *node.mn_metaman, *node.mnhf_manager, *node.sporkman, *node.mempool,
119+
/*mn_activeman=*/nullptr, *node.mn_sync, /*unit_tests=*/true, /*wipe=*/false);
120120
Assert(node.mnhf_manager)->ConnectManagers(node.chainman.get(), node.llmq_ctx->qman.get());
121121
node.chain_helper = std::make_unique<CChainstateHelper>(*node.cpoolman, *node.dmnman, *node.mnhf_manager, *node.govman, *(node.llmq_ctx->quorum_block_processor), *node.chainman,
122122
chainparams.GetConsensus(), *node.mn_sync, *node.sporkman, *(node.llmq_ctx->clhandler), *(node.llmq_ctx->qman));

0 commit comments

Comments
 (0)