aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPatrick Strateman <patrick.strateman@gmail.com>2013-10-28 13:20:21 -0700
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-26 10:15:49 +0100
commit7084756f4f4e34818659a10f62933fcfc77fe27f (patch)
tree8e3112cdd38a6fafba4492df09ecf7be5269b136 /src/main.cpp
parentef14a26b12ad63cbe109e24043b0b1ce5c07447a (diff)
downloadbitcoin-7084756f4f4e34818659a10f62933fcfc77fe27f.tar.xz
process received messages one at a time without sleeping between messages
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ce45133a9f..d4816ca22f 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3141,6 +3141,9 @@ void static ProcessGetData(CNode* pfrom)
// Track requests for our stuff.
Inventory(inv.hash);
+
+ if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK)
+ break;
}
}
@@ -3751,6 +3754,9 @@ bool ProcessMessages(CNode* pfrom)
if (!pfrom->vRecvGetData.empty())
ProcessGetData(pfrom);
+ // this maintains the order of responses
+ if (!pfrom->vRecvGetData.empty()) return fOk;
+
std::deque<CNetMessage>::iterator it = pfrom->vRecvMsg.begin();
while (!pfrom->fDisconnect && it != pfrom->vRecvMsg.end()) {
// Don't bother if send buffer is too full to respond anyway
@@ -3841,6 +3847,8 @@ bool ProcessMessages(CNode* pfrom)
if (!fRet)
printf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
+
+ break;
}
// In case the connection got shut down, its receive buffer was wiped