aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmiti Uttarwar <amiti@uttarwar.org>2020-05-12 14:48:24 -0700
committerAmiti Uttarwar <amiti@uttarwar.org>2020-08-07 17:18:16 -0700
commitaf59feb05235ecb85ec9d75b09c66e71268c9889 (patch)
tree1b473ffa4a8e7107afd4b128e37b750370811e6e
parente1bc29812ddf1d946bc5acca406a7ed2dca064a6 (diff)
[net/refactor] Extract m_addr_known logic from initializer list
-rw-r--r--src/net.cpp2
-rw-r--r--src/net.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net.cpp b/src/net.cpp
index e18128dc1c..fd1cb3e64a 100644
--- a/src/net.cpp
+++ b/src/net.cpp
@@ -2748,7 +2748,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
// Don't relay addr messages to peers that we connect to as block-relay-only
// peers (to prevent adversaries from inferring these links from addr
// traffic).
- m_addr_known{conn_type_in == ConnectionType::BLOCK_RELAY ? nullptr : MakeUnique<CRollingBloomFilter>(5000, 0.001)},
id(idIn),
nLocalHostNonce(nLocalHostNonceIn),
nLocalServices(nLocalServicesIn),
@@ -2759,6 +2758,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
hashContinue = uint256();
if (conn_type_in != ConnectionType::BLOCK_RELAY) {
m_tx_relay = MakeUnique<TxRelay>();
+ m_addr_known = MakeUnique<CRollingBloomFilter>(5000, 0.001);
}
for (const std::string &msg : getAllNetMessageTypes())
diff --git a/src/net.h b/src/net.h
index 21ee6e72a9..d3a423fd13 100644
--- a/src/net.h
+++ b/src/net.h
@@ -799,7 +799,7 @@ public:
// flood relay
std::vector<CAddress> vAddrToSend;
- const std::unique_ptr<CRollingBloomFilter> m_addr_known;
+ std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr;
bool fGetAddr{false};
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};