[net] Construct addrman outside connman

node.context owns the CAddrMan. CConnman holds a reference to
the CAddrMan.
This commit is contained in:
John Newbery
2020-10-23 09:34:27 +01:00
parent 3530d5d2d8
commit 1c25adf6d2
8 changed files with 21 additions and 11 deletions

View File

@@ -4,6 +4,7 @@
#include <node/context.h>
#include <addrman.h>
#include <banman.h>
#include <interfaces/chain.h>
#include <net.h>

View File

@@ -12,6 +12,7 @@
class ArgsManager;
class BanMan;
class CAddrMan;
class CBlockPolicyEstimator;
class CConnman;
class CScheduler;
@@ -35,6 +36,7 @@ class WalletClient;
//! any member functions. It should just be a collection of references that can
//! be used without pulling in unwanted dependencies or functionality.
struct NodeContext {
std::unique_ptr<CAddrMan> addrman;
std::unique_ptr<CConnman> connman;
std::unique_ptr<CTxMemPool> mempool;
std::unique_ptr<CBlockPolicyEstimator> fee_estimator;