aboutsummaryrefslogtreecommitdiff
path: root/main.cpp
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-06-15 18:26:32 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-06-15 18:26:32 +0000
commitd0ac235c8fecb15beddde9563e2a0964c670fff9 (patch)
tree6bd0c2671065191db077713ab84b8e7832954ba5 /main.cpp
parent78c7bb8e26c53a4be3104410d9330a2b8e0ffd78 (diff)
more addr message error checking
-- version 0.2.11
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index aef68838cb..13b7828dd5 100644
--- a/main.cpp
+++ b/main.cpp
@@ -1926,7 +1926,9 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
{
vector<CAddress> vAddr;
vRecv >> vAddr;
- if (vAddr.size() > 50000) // lower this to 1000 later
+ if (pfrom->nVersion < 200) // don't want addresses from 0.1.5
+ return true;
+ if (vAddr.size() > 1000)
return error("message addr size() = %d", vAddr.size());
// Store the new addresses
@@ -2311,6 +2313,7 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
if (pto->setAddrKnown.insert(addr).second)
{
vAddr.push_back(addr);
+ // receiver rejects addr messages larger than 1000
if (vAddr.size() >= 1000)
{
pto->PushMessage("addr", vAddr);