mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +01:00
scripted-diff: [net processing] Rename PeerLogicValidation to PeerManager
-BEGIN VERIFY SCRIPT- sed -i 's/PeerLogicValidation/PeerManager/g' $(git grep -l PeerLogicValidation ./src ./test) sed -i 's/peer_logic/peerman/g' $(git grep -l peer_logic ./src ./test) -END VERIFY SCRIPT- PeerLogicValidation was originally net_processing's implementation to the validation interface. It has since grown to contain much of net_processing's logic. Therefore rename it to reflect its responsibilities. Suggested in https://github.com/bitcoin/bitcoin/pull/10756#pullrequestreview-53892618.
This commit is contained in:
10
src/init.cpp
10
src/init.cpp
@@ -200,7 +200,7 @@ void Shutdown(NodeContext& node)
|
||||
|
||||
// Because these depend on each-other, we make sure that neither can be
|
||||
// using the other before destroying them.
|
||||
if (node.peer_logic) UnregisterValidationInterface(node.peer_logic.get());
|
||||
if (node.peerman) UnregisterValidationInterface(node.peerman.get());
|
||||
// Follow the lock order requirements:
|
||||
// * CheckForStaleTipAndEvictPeers locks cs_main before indirectly calling GetExtraOutboundCount
|
||||
// which locks cs_vNodes.
|
||||
@@ -227,7 +227,7 @@ void Shutdown(NodeContext& node)
|
||||
|
||||
// After the threads that potentially access these pointers have been stopped,
|
||||
// destruct and reset all to nullptr.
|
||||
node.peer_logic.reset();
|
||||
node.peerman.reset();
|
||||
node.connman.reset();
|
||||
node.banman.reset();
|
||||
|
||||
@@ -1376,8 +1376,8 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
||||
node.chainman = &g_chainman;
|
||||
ChainstateManager& chainman = *Assert(node.chainman);
|
||||
|
||||
node.peer_logic.reset(new PeerLogicValidation(chainparams, *node.connman, node.banman.get(), *node.scheduler, chainman, *node.mempool));
|
||||
RegisterValidationInterface(node.peer_logic.get());
|
||||
node.peerman.reset(new PeerManager(chainparams, *node.connman, node.banman.get(), *node.scheduler, chainman, *node.mempool));
|
||||
RegisterValidationInterface(node.peerman.get());
|
||||
|
||||
// sanitize comments per BIP-0014, format user agent and check total size
|
||||
std::vector<std::string> uacomments;
|
||||
@@ -1911,7 +1911,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
|
||||
connOptions.nBestHeight = chain_active_height;
|
||||
connOptions.uiInterface = &uiInterface;
|
||||
connOptions.m_banman = node.banman.get();
|
||||
connOptions.m_msgproc = node.peer_logic.get();
|
||||
connOptions.m_msgproc = node.peerman.get();
|
||||
connOptions.nSendBufferMaxSize = 1000 * args.GetArg("-maxsendbuffer", DEFAULT_MAXSENDBUFFER);
|
||||
connOptions.nReceiveFloodSize = 1000 * args.GetArg("-maxreceivebuffer", DEFAULT_MAXRECEIVEBUFFER);
|
||||
connOptions.m_added_nodes = args.GetArgs("-addnode");
|
||||
|
||||
Reference in New Issue
Block a user