aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorGavin Andresen <gavinandresen@gmail.com>2013-08-27 16:12:43 +1000
committerGavin Andresen <gavinandresen@gmail.com>2013-10-26 14:14:31 +1000
commit1f3d3647ffb49943f485c9a663f0644ca7d110de (patch)
treec01af3f0cdcdfc966fc5a72138314a94f763bbee /src/main.cpp
parent0d09b3e8b0218169ab7ad2aa787c43ea11bc7060 (diff)
Send multiple inv messages if mempool.size > MAX_INV_SZ
Changes the response to the 'mempool' command so that if the memory pool has more than MAX_INV_SZ transactions (50,000) it will respond with multiple 'inv' messages.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 01a1babc7f..6ffbc5a44e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3814,8 +3814,10 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
if ((pfrom->pfilter && pfrom->pfilter->IsRelevantAndUpdate(mempool.lookup(hash), hash)) ||
(!pfrom->pfilter))
vInv.push_back(inv);
- if (vInv.size() == MAX_INV_SZ)
- break;
+ if (vInv.size() == MAX_INV_SZ) {
+ pfrom->PushMessage("inv", vInv);
+ vInv.clear();
+ }
}
if (vInv.size() > 0)
pfrom->PushMessage("inv", vInv);