aboutsummaryrefslogtreecommitdiff
path: root/src/test/util
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-08-12 11:38:56 +0100
committerJohn Newbery <john@johnnewbery.com>2020-08-12 14:25:28 +0100
commitc556770b5ef4306f10e980daff772bee87daaa30 (patch)
tree3f75227574331890f74d8e5e20e38e348c9d1896 /src/test/util
parentbd00d3b1f2036893419d1e8c514a8af2c4e4b1fb (diff)
downloadbitcoin-c556770b5ef4306f10e980daff772bee87daaa30.tar.xz
[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/test/util')
-rw-r--r--src/test/util/setup_common.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/util/setup_common.cpp b/src/test/util/setup_common.cpp
index b2ae1cb845..9d63aad672 100644
--- a/src/test/util/setup_common.cpp
+++ b/src/test/util/setup_common.cpp
@@ -168,7 +168,7 @@ TestingSetup::TestingSetup(const std::string& chainName, const std::vector<const
m_node.mempool->setSanityCheck(1.0);
m_node.banman = MakeUnique<BanMan>(GetDataDir() / "banlist.dat", nullptr, DEFAULT_MISBEHAVING_BANTIME);
m_node.connman = MakeUnique<CConnman>(0x1337, 0x1337); // Deterministic randomness for tests.
- m_node.peer_logic = MakeUnique<PeerLogicValidation>(m_node.connman.get(), m_node.banman.get(), *m_node.scheduler, *m_node.chainman, *m_node.mempool);
+ m_node.peer_logic = MakeUnique<PeerLogicValidation>(*m_node.connman, m_node.banman.get(), *m_node.scheduler, *m_node.chainman, *m_node.mempool);
{
CConnman::Options options;
options.m_msgproc = m_node.peer_logic.get();