mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
refactor: remove unused CConnman
from CDeterministicMNManager
ctor
This commit is contained in:
parent
a14e604064
commit
ac930a84d8
@ -30,7 +30,6 @@ class CBlock;
|
|||||||
class CBlockIndex;
|
class CBlockIndex;
|
||||||
class CChainState;
|
class CChainState;
|
||||||
class CCoinsViewCache;
|
class CCoinsViewCache;
|
||||||
class CConnman;
|
|
||||||
class CEvoDB;
|
class CEvoDB;
|
||||||
class TxValidationState;
|
class TxValidationState;
|
||||||
|
|
||||||
@ -583,7 +582,6 @@ private:
|
|||||||
std::atomic<int> to_cleanup {0};
|
std::atomic<int> to_cleanup {0};
|
||||||
|
|
||||||
CChainState& m_chainstate;
|
CChainState& m_chainstate;
|
||||||
CConnman& connman;
|
|
||||||
CEvoDB& m_evoDb;
|
CEvoDB& m_evoDb;
|
||||||
|
|
||||||
std::unordered_map<uint256, CDeterministicMNList, StaticSaltedHasher> mnListsCache GUARDED_BY(cs);
|
std::unordered_map<uint256, CDeterministicMNList, StaticSaltedHasher> mnListsCache GUARDED_BY(cs);
|
||||||
@ -592,8 +590,11 @@ private:
|
|||||||
const CBlockIndex* m_initial_snapshot_index GUARDED_BY(cs) {nullptr};
|
const CBlockIndex* m_initial_snapshot_index GUARDED_BY(cs) {nullptr};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CDeterministicMNManager(CChainState& chainstate, CConnman& _connman, CEvoDB& evoDb) :
|
explicit CDeterministicMNManager(CChainState& chainstate, CEvoDB& evoDb) :
|
||||||
m_chainstate(chainstate), connman(_connman), m_evoDb(evoDb) {}
|
m_chainstate(chainstate),
|
||||||
|
m_evoDb(evoDb)
|
||||||
|
{
|
||||||
|
}
|
||||||
~CDeterministicMNManager() = default;
|
~CDeterministicMNManager() = default;
|
||||||
|
|
||||||
bool ProcessBlock(const CBlock& block, gsl::not_null<const CBlockIndex*> pindex, BlockValidationState& state,
|
bool ProcessBlock(const CBlock& block, gsl::not_null<const CBlockIndex*> pindex, BlockValidationState& state,
|
||||||
|
@ -1888,7 +1888,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
|
|
||||||
// Same logic as above with pblocktree
|
// Same logic as above with pblocktree
|
||||||
node.dmnman.reset();
|
node.dmnman.reset();
|
||||||
node.dmnman = std::make_unique<CDeterministicMNManager>(chainman.ActiveChainstate(), *node.connman, *node.evodb);
|
node.dmnman = std::make_unique<CDeterministicMNManager>(chainman.ActiveChainstate(), *node.evodb);
|
||||||
node.mempool->ConnectManagers(node.dmnman.get());
|
node.mempool->ConnectManagers(node.dmnman.get());
|
||||||
|
|
||||||
node.cpoolman.reset();
|
node.cpoolman.reset();
|
||||||
|
@ -107,7 +107,7 @@ void DashTestSetup(NodeContext& node, const CChainParams& chainparams)
|
|||||||
{
|
{
|
||||||
CChainState& chainstate = Assert(node.chainman)->ActiveChainstate();
|
CChainState& chainstate = Assert(node.chainman)->ActiveChainstate();
|
||||||
|
|
||||||
node.dmnman = std::make_unique<CDeterministicMNManager>(chainstate, *node.connman, *node.evodb);
|
node.dmnman = std::make_unique<CDeterministicMNManager>(chainstate, *node.evodb);
|
||||||
node.mempool->ConnectManagers(node.dmnman.get());
|
node.mempool->ConnectManagers(node.dmnman.get());
|
||||||
|
|
||||||
node.cj_ctx = std::make_unique<CJContext>(*node.chainman, *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,
|
node.cj_ctx = std::make_unique<CJContext>(*node.chainman, *node.connman, *node.dmnman, *node.mn_metaman, *node.mempool,
|
||||||
|
Loading…
Reference in New Issue
Block a user