mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
[init] Add netgroupman to node.context
This is constructed before addrman and connman, and destructed afterwards. netgroupman does not currently do anything, but will have functionality added in future commits.
This commit is contained in:
parent
9b3836710b
commit
17c24d4580
3 changed files with 11 additions and 2 deletions
10
src/init.cpp
10
src/init.cpp
|
@ -33,6 +33,7 @@
|
|||
#include <net_permissions.h>
|
||||
#include <net_processing.h>
|
||||
#include <netbase.h>
|
||||
#include <netgroup.h>
|
||||
#include <node/blockstorage.h>
|
||||
#include <node/caches.h>
|
||||
#include <node/chainstate.h>
|
||||
|
@ -240,6 +241,7 @@ void Shutdown(NodeContext& node)
|
|||
node.connman.reset();
|
||||
node.banman.reset();
|
||||
node.addrman.reset();
|
||||
node.netgroupman.reset();
|
||||
|
||||
if (node.mempool && node.mempool->IsLoaded() && node.args->GetBoolArg("-persistmempool", DEFAULT_PERSIST_MEMPOOL)) {
|
||||
DumpMempool(*node.mempool);
|
||||
|
@ -1229,8 +1231,6 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
const bool ignores_incoming_txs{args.GetBoolArg("-blocksonly", DEFAULT_BLOCKSONLY)};
|
||||
|
||||
{
|
||||
// Initialize addrman
|
||||
assert(!node.addrman);
|
||||
|
||||
// Read asmap file if configured
|
||||
std::vector<bool> asmap;
|
||||
|
@ -1254,6 +1254,12 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||
LogPrintf("Using /16 prefix for IP bucketing\n");
|
||||
}
|
||||
|
||||
// Initialize netgroup manager
|
||||
assert(!node.netgroupman);
|
||||
node.netgroupman = std::make_unique<NetGroupManager>();
|
||||
|
||||
// Initialize addrman
|
||||
assert(!node.addrman);
|
||||
uiInterface.InitMessage(_("Loading P2P addresses…").translated);
|
||||
if (const auto error{LoadAddrman(asmap, args, node.addrman)}) {
|
||||
return InitError(*error);
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <interfaces/chain.h>
|
||||
#include <net.h>
|
||||
#include <net_processing.h>
|
||||
#include <netgroup.h>
|
||||
#include <policy/fees.h>
|
||||
#include <scheduler.h>
|
||||
#include <txmempool.h>
|
||||
|
|
|
@ -18,6 +18,7 @@ class CConnman;
|
|||
class CScheduler;
|
||||
class CTxMemPool;
|
||||
class ChainstateManager;
|
||||
class NetGroupManager;
|
||||
class PeerManager;
|
||||
namespace interfaces {
|
||||
class Chain;
|
||||
|
@ -43,6 +44,7 @@ struct NodeContext {
|
|||
std::unique_ptr<AddrMan> addrman;
|
||||
std::unique_ptr<CConnman> connman;
|
||||
std::unique_ptr<CTxMemPool> mempool;
|
||||
std::unique_ptr<const NetGroupManager> netgroupman;
|
||||
std::unique_ptr<CBlockPolicyEstimator> fee_estimator;
|
||||
std::unique_ptr<PeerManager> peerman;
|
||||
std::unique_ptr<ChainstateManager> chainman;
|
||||
|
|
Loading…
Add table
Reference in a new issue