aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-10-22 10:39:24 +0100
committerJohn Newbery <john@johnnewbery.com>2020-12-09 18:10:38 +0000
commit4d510aa055064df5a10c2cc7888baffc3e6bc0e6 (patch)
tree8509271fb786ec9ddd190df1bbae320d3563acaf /src/init.cpp
parentf3f61d0eb937ada5fd00d7d590f5f29325f7f414 (diff)
[init] Use MakeUnique<> to construct peerman
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 371399de9e..3e7d539c0d 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1396,7 +1396,8 @@ bool AppInitMain(const util::Ref& context, NodeContext& node, interfaces::BlockA
node.chainman = &g_chainman;
ChainstateManager& chainman = *Assert(node.chainman);
- node.peerman.reset(new PeerManager(chainparams, *node.connman, node.banman.get(), *node.scheduler, chainman, *node.mempool));
+ assert(!node.peerman);
+ node.peerman = MakeUnique<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