diff options
author | User <naumenko.gs@gmail.com> | 2019-10-16 17:06:20 -0400 |
---|---|---|
committer | User <naumenko.gs@gmail.com> | 2019-10-16 17:06:20 -0400 |
commit | 090b75c14be6b9ba2efe38a17d141c6e6af575cb (patch) | |
tree | a19fd9414b69ae3e0b5a5ac70804e5537e7c5539 /src/net.cpp | |
parent | c34b88620dc8435b83e6744895f2ecd3c9ec8de7 (diff) |
p2p: Avoid allocating memory for addrKnown where we don't need it
Diffstat (limited to 'src/net.cpp')
-rw-r--r-- | src/net.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net.cpp b/src/net.cpp index 63b7833822..df52689092 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2652,7 +2652,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn addrBind(addrBindIn), fInbound(fInboundIn), nKeyedNetGroup(nKeyedNetGroupIn), - addrKnown(5000, 0.001), // 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). @@ -2669,6 +2668,10 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn m_tx_relay = MakeUnique<TxRelay>(); } + if (m_addr_relay_peer) { + m_addr_known = MakeUnique<CRollingBloomFilter>(5000, 0.001); + } + for (const std::string &msg : getAllNetMessageTypes()) mapRecvBytesPerMsgCmd[msg] = 0; mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0; |