mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-25 08:21:24 +02:00
[net/refactor] Extract m_addr_known logic from initializer list
This commit is contained in:
parent
e1bc29812d
commit
af59feb052
@ -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
|
// 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
|
// peers (to prevent adversaries from inferring these links from addr
|
||||||
// traffic).
|
// traffic).
|
||||||
m_addr_known{conn_type_in == ConnectionType::BLOCK_RELAY ? nullptr : MakeUnique<CRollingBloomFilter>(5000, 0.001)},
|
|
||||||
id(idIn),
|
id(idIn),
|
||||||
nLocalHostNonce(nLocalHostNonceIn),
|
nLocalHostNonce(nLocalHostNonceIn),
|
||||||
nLocalServices(nLocalServicesIn),
|
nLocalServices(nLocalServicesIn),
|
||||||
@ -2759,6 +2758,7 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
|
|||||||
hashContinue = uint256();
|
hashContinue = uint256();
|
||||||
if (conn_type_in != ConnectionType::BLOCK_RELAY) {
|
if (conn_type_in != ConnectionType::BLOCK_RELAY) {
|
||||||
m_tx_relay = MakeUnique<TxRelay>();
|
m_tx_relay = MakeUnique<TxRelay>();
|
||||||
|
m_addr_known = MakeUnique<CRollingBloomFilter>(5000, 0.001);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const std::string &msg : getAllNetMessageTypes())
|
for (const std::string &msg : getAllNetMessageTypes())
|
||||||
|
@ -799,7 +799,7 @@ public:
|
|||||||
|
|
||||||
// flood relay
|
// flood relay
|
||||||
std::vector<CAddress> vAddrToSend;
|
std::vector<CAddress> vAddrToSend;
|
||||||
const std::unique_ptr<CRollingBloomFilter> m_addr_known;
|
std::unique_ptr<CRollingBloomFilter> m_addr_known = nullptr;
|
||||||
bool fGetAddr{false};
|
bool fGetAddr{false};
|
||||||
std::chrono::microseconds m_next_addr_send GUARDED_BY(cs_sendProcessing){0};
|
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};
|
std::chrono::microseconds m_next_local_addr_send GUARDED_BY(cs_sendProcessing){0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user