aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main.cpp b/src/main.cpp
index ecb9711664..145ff7857e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -41,7 +41,6 @@ bool fReindex = false;
bool fBenchmark = false;
bool fTxIndex = false;
unsigned int nCoinCacheSize = 5000;
-bool fHaveGUI = false;
/** Fees smaller than this (in satoshi) are considered zero fee (for transaction creation) */
int64 CTransaction::nMinTxFee = 10000; // Override with -mintxfee
@@ -3155,6 +3154,9 @@ void static ProcessGetData(CNode* pfrom)
// Track requests for our stuff.
g_signals.Inventory(inv.hash);
+
+ if (inv.type == MSG_BLOCK || inv.type == MSG_FILTERED_BLOCK)
+ break;
}
}
@@ -3200,10 +3202,9 @@ bool static ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv)
CAddress addrFrom;
uint64 nNonce = 1;
vRecv >> pfrom->nVersion >> pfrom->nServices >> nTime >> addrMe;
- if (pfrom->nVersion < MIN_PROTO_VERSION)
+ if (pfrom->nVersion < MIN_PEER_PROTO_VERSION)
{
- // Since February 20, 2012, the protocol is initiated at version 209,
- // and earlier versions are no longer supported
+ // disconnect from peers older than this proto version
LogPrintf("partner %s using obsolete version %i; disconnecting\n", pfrom->addr.ToString().c_str(), pfrom->nVersion);
pfrom->fDisconnect = true;
return false;
@@ -3841,7 +3842,10 @@ 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
@@ -3929,6 +3933,8 @@ bool ProcessMessages(CNode* pfrom)
if (!fRet)
LogPrintf("ProcessMessage(%s, %u bytes) FAILED\n", strCommand.c_str(), nMessageSize);
+
+ break;
}
// In case the connection got shut down, its receive buffer was wiped