diff options
| author | John Newbery <[email protected]> | 2020-08-12 11:38:56 +0100 |
|---|---|---|
| committer | John Newbery <[email protected]> | 2020-08-12 14:25:28 +0100 |
| commit | c556770b5ef4306f10e980daff772bee87daaa30 (patch) | |
| tree | 3f75227574331890f74d8e5e20e38e348c9d1896 /src/init.cpp | |
| parent | Merge #19658: [rpc] Allow RPC to fetch all addrman records and add records to... (diff) | |
| download | discoin-c556770b5ef4306f10e980daff772bee87daaa30.tar.xz discoin-c556770b5ef4306f10e980daff772bee87daaa30.zip | |
[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.
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index 08944b79a..8fc7ad8f0 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1384,7 +1384,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node) node.chainman = &g_chainman; ChainstateManager& chainman = *Assert(node.chainman); - node.peer_logic.reset(new PeerLogicValidation(node.connman.get(), node.banman.get(), *node.scheduler, chainman, *node.mempool)); + node.peer_logic.reset(new PeerLogicValidation(*node.connman, node.banman.get(), *node.scheduler, chainman, *node.mempool)); RegisterValidationInterface(node.peer_logic.get()); // sanitize comments per BIP-0014, format user agent and check total size |