aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2015-02-03 10:36:34 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2015-02-03 10:36:44 +0100
commit6ee87f9bc5d8a4a9f9cac24d8ba85f6769e8f312 (patch)
treebb7e95ed4d4098944d99a8bf0b7a934686c5e106
parent4e2b1fff98a36a07028457e48967d64ed0ce4386 (diff)
parent3ff735c99ae75c21397079f49859b81e89a2f5f8 (diff)
Merge pull request #5647
3ff735c Increase block download timeout base from 10 to 20 minutes. (Gregory Maxwell)
-rw-r--r--src/main.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0afcae4b57..38a22e4297 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4546,12 +4546,12 @@ bool SendMessages(CNode* pto, bool fSendTrickle)
LogPrintf("Peer=%d is stalling block download, disconnecting\n", pto->id);
pto->fDisconnect = true;
}
- // In case there is a block that has been in flight from this peer for (1 + 0.5 * N) times the block interval
+ // In case there is a block that has been in flight from this peer for (2 + 0.5 * N) times the block interval
// (with N the number of validated blocks that were in flight at the time it was requested), disconnect due to
// timeout. We compensate for in-flight blocks to prevent killing off peers due to our own downstream link
// being saturated. We only count validated in-flight blocks so peers can't advertize nonexisting block hashes
// to unreasonably increase our timeout.
- if (!pto->fDisconnect && state.vBlocksInFlight.size() > 0 && state.vBlocksInFlight.front().nTime < nNow - 500000 * Params().TargetSpacing() * (2 + state.vBlocksInFlight.front().nValidatedQueuedBefore)) {
+ if (!pto->fDisconnect && state.vBlocksInFlight.size() > 0 && state.vBlocksInFlight.front().nTime < nNow - 500000 * Params().TargetSpacing() * (4 + state.vBlocksInFlight.front().nValidatedQueuedBefore)) {
LogPrintf("Timeout downloading block %s from peer=%d, disconnecting\n", state.vBlocksInFlight.front().hash.ToString(), pto->id);
pto->fDisconnect = true;
}