net_processing: split PeerManager into interface and implementation classes

This commit is contained in:
Anthony Towns
2020-12-23 17:35:33 +10:00
parent 0df3d3fd6b
commit a568b82feb
6 changed files with 109 additions and 77 deletions

View File

@@ -1410,8 +1410,8 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
ChainstateManager& chainman = *Assert(node.chainman);
assert(!node.peerman);
node.peerman = std::make_unique<PeerManager>(chainparams, *node.connman, node.banman.get(),
*node.scheduler, chainman, *node.mempool, ignores_incoming_txs);
node.peerman = PeerManager::make(chainparams, *node.connman, node.banman.get(),
*node.scheduler, chainman, *node.mempool, ignores_incoming_txs);
RegisterValidationInterface(node.peerman.get());
// sanitize comments per BIP-0014, format user agent and check total size