Don't relay addr messages to block-relay-only peers

We don't want relay of addr messages to leak information about
these network links.
This commit is contained in:
Suhas Daftuar
2019-04-05 13:35:15 -04:00
parent 3a5e885306
commit 430f489027
3 changed files with 19 additions and 4 deletions

View File

@@ -2647,6 +2647,10 @@ CNode::CNode(NodeId idIn, ServiceFlags nLocalServicesIn, int nMyStartingHeightIn
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).
m_addr_relay_peer(!block_relay_only),
id(idIn),
nLocalHostNonce(nLocalHostNonceIn),
nLocalServices(nLocalServicesIn),