Cache responses to addr requests

Prevents a spy from scraping victim's AddrMan by
reconnecting and re-requesting addrs.
This commit is contained in:
Gleb Naumenko
2020-05-16 21:05:44 -04:00
parent 7cc0e8101f
commit acd6135b43
3 changed files with 43 additions and 1 deletions

View File

@@ -3477,7 +3477,7 @@ void ProcessMessage(
pfrom.fSentAddr = true;
pfrom.vAddrToSend.clear();
std::vector<CAddress> vAddr = connman.GetAddresses();
std::vector<CAddress> vAddr = connman.GetAddresses(pfrom.addr.GetNetwork());
FastRandomContext insecure_rand;
for (const CAddress &addr : vAddr) {
pfrom.PushAddress(addr, insecure_rand);