diff options
| author | Wladimir J. van der Laan <[email protected]> | 2016-04-15 09:02:41 +0200 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2016-04-15 09:03:17 +0200 |
| commit | 64e71b37210a1131de98efbbcbf2392f3e3696ac (patch) | |
| tree | 6520f21433e9add20f759c6a92f608022ff33c55 /src/main.cpp | |
| parent | Merge #7877: Change mapRelay to store CTransactions (diff) | |
| parent | Only send one GetAddr response per connection. (diff) | |
| download | discoin-64e71b37210a1131de98efbbcbf2392f3e3696ac.tar.xz discoin-64e71b37210a1131de98efbbcbf2392f3e3696ac.zip | |
Merge #7856: Only send one GetAddr response per connection.
66b0724 Only send one GetAddr response per connection. (Gregory Maxwell)
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp index ed9ee1654..a94d52f89 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5212,6 +5212,14 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv, return true; } + // Only send one GetAddr response per connection to reduce resource waste + // and discourage addr stamping of INV announcements. + if (pfrom->fSentAddr) { + LogPrint("net", "Ignoring repeated \"getaddr\". peer=%d\n", pfrom->id); + return true; + } + pfrom->fSentAddr = true; + pfrom->vAddrToSend.clear(); vector<CAddress> vAddr = addrman.GetAddr(); BOOST_FOREACH(const CAddress &addr, vAddr) |