Skip to content

Commit c556770

Browse files
committed
[net_processing] Change PeerLogicValidation to hold a connman reference
Hold a reference to connman rather than a pointer because: - PeerLogicValidation can't run without a connman - The pointer never gets reseated The alternative is to always assert that the pointer is non-null before dereferencing. Change the name from connman to m_connman at the same time to conform with current style guidelines.
1 parent bd00d3b commit c556770

File tree

5 files changed

+49
-51
lines changed

5 files changed

+49
-51
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
13841384
node.chainman = &g_chainman;
13851385
ChainstateManager& chainman = *Assert(node.chainman);
13861386

1387-
node.peer_logic.reset(new PeerLogicValidation(node.connman.get(), node.banman.get(), *node.scheduler, chainman, *node.mempool));
1387+
node.peer_logic.reset(new PeerLogicValidation(*node.connman, node.banman.get(), *node.scheduler, chainman, *node.mempool));
13881388
RegisterValidationInterface(node.peer_logic.get());
13891389

13901390
// sanitize comments per BIP-0014, format user agent and check total size

0 commit comments

Comments
 (0)