From ac930a84d80a89b67af42c1c30a0537838400339 Mon Sep 17 00:00:00 2001 From: Kittywhiskers Van Gogh <63189531+kwvg@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:18:08 +0000 Subject: [PATCH] refactor: remove unused `CConnman` from `CDeterministicMNManager` ctor --- src/evo/deterministicmns.h | 9 +++++---- src/init.cpp | 2 +- src/test/util/setup_common.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/evo/deterministicmns.h b/src/evo/deterministicmns.h index 52119350f1..81621d8bd9 100644 --- a/src/evo/deterministicmns.h +++ b/src/evo/deterministicmns.h @@ -30,7 +30,6 @@ class CBlock; class CBlockIndex; class CChainState; class CCoinsViewCache; -class CConnman; class CEvoDB; class TxValidationState; @@ -583,7 +582,6 @@ private: std::atomic to_cleanup {0}; CChainState& m_chainstate; - CConnman& connman; CEvoDB& m_evoDb; std::unordered_map mnListsCache GUARDED_BY(cs); @@ -592,8 +590,11 @@ private: const CBlockIndex* m_initial_snapshot_index GUARDED_BY(cs) {nullptr}; public: - explicit CDeterministicMNManager(CChainState& chainstate, CConnman& _connman, CEvoDB& evoDb) : - m_chainstate(chainstate), connman(_connman), m_evoDb(evoDb) {} + explicit CDeterministicMNManager(CChainState& chainstate, CEvoDB& evoDb) : + m_chainstate(chainstate), + m_evoDb(evoDb) + { + } ~CDeterministicMNManager() = default; bool ProcessBlock(const CBlock& block, gsl::not_null pindex, BlockValidationState& state, diff --git a/src/init.cpp b/src/init.cpp index 8f856ad586..9adbf1aec7 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1888,7 +1888,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) // Same logic as above with pblocktree node.dmnman.reset(); - node.dmnman = std::make_unique(chainman.ActiveChainstate(), *node.connman, *node.evodb); + node.dmnman = std::make_unique(chainman.ActiveChainstate(), *node.evodb); node.mempool->ConnectManagers(node.dmnman.get()); node.cpoolman.reset(); diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp index ccf13074ce..3e84fc87dd 100644 --- a/src/test/util/setup_common.cpp +++ b/src/test/util/setup_common.cpp @@ -107,7 +107,7 @@ void DashTestSetup(NodeContext& node, const CChainParams& chainparams) { CChainState& chainstate = Assert(node.chainman)->ActiveChainstate(); - node.dmnman = std::make_unique(chainstate, *node.connman, *node.evodb); + node.dmnman = std::make_unique(chainstate, *node.evodb); node.mempool->ConnectManagers(node.dmnman.get()); node.cj_ctx = std::make_unique(*node.chainman, *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,