mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-04-28 21:33:25 +02:00
Minor refactoring to remove implied m_addr_relay_peer.
Co-authored-by: MarcoFalke <falke.marco@gmail.com>
This commit is contained in:
parent
a552e8477c
commit
b6d2183858
@ -2655,7 +2655,7 @@ 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_relay_peer(!block_relay_only),
|
m_addr_known{block_relay_only ? nullptr : MakeUnique<CRollingBloomFilter>(5000, 0.001)},
|
||||||
id(idIn),
|
id(idIn),
|
||||||
nLocalHostNonce(nLocalHostNonceIn),
|
nLocalHostNonce(nLocalHostNonceIn),
|
||||||
nLocalServices(nLocalServicesIn),
|
nLocalServices(nLocalServicesIn),
|
||||||
@ -2668,10 +2668,6 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
|
|||||||
m_tx_relay = MakeUnique<TxRelay>();
|
m_tx_relay = MakeUnique<TxRelay>();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_addr_relay_peer) {
|
|
||||||
m_addr_known = MakeUnique<CRollingBloomFilter>(5000, 0.001);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const std::string &msg : getAllNetMessageTypes())
|
for (const std::string &msg : getAllNetMessageTypes())
|
||||||
mapRecvBytesPerMsgCmd[msg] = 0;
|
mapRecvBytesPerMsgCmd[msg] = 0;
|
||||||
mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;
|
mapRecvBytesPerMsgCmd[NET_MESSAGE_COMMAND_OTHER] = 0;
|
||||||
|
@ -729,13 +729,12 @@ public:
|
|||||||
|
|
||||||
// flood relay
|
// flood relay
|
||||||
std::vector<CAddress> vAddrToSend;
|
std::vector<CAddress> vAddrToSend;
|
||||||
std::unique_ptr<CRollingBloomFilter> m_addr_known;
|
const std::unique_ptr<CRollingBloomFilter> m_addr_known;
|
||||||
bool fGetAddr{false};
|
bool fGetAddr{false};
|
||||||
int64_t nNextAddrSend GUARDED_BY(cs_sendProcessing){0};
|
int64_t nNextAddrSend GUARDED_BY(cs_sendProcessing){0};
|
||||||
int64_t nNextLocalAddrSend GUARDED_BY(cs_sendProcessing){0};
|
int64_t nNextLocalAddrSend GUARDED_BY(cs_sendProcessing){0};
|
||||||
|
|
||||||
const bool m_addr_relay_peer;
|
bool IsAddrRelayPeer() const { return m_addr_known != nullptr; }
|
||||||
bool IsAddrRelayPeer() const { return m_addr_relay_peer; }
|
|
||||||
|
|
||||||
// List of block ids we still have announce.
|
// List of block ids we still have announce.
|
||||||
// There is no final sorting before sending, as they are always sent immediately
|
// There is no final sorting before sending, as they are always sent immediately
|
||||||
|
Loading…
x
Reference in New Issue
Block a user