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

@@ -712,6 +712,9 @@ public:
int64_t nNextAddrSend 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_relay_peer; }
// List of block ids we still have announce.
// There is no final sorting before sending, as they are always sent immediately
// and in the order requested.
@@ -748,6 +751,7 @@ public:
// m_tx_relay == nullptr if we're not relaying transactions with this peer
std::unique_ptr<TxRelay> m_tx_relay;
// Used for headers announcements - unfiltered blocks to relay
std::vector<uint256> vBlockHashesToAnnounce GUARDED_BY(cs_inventory);