aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-04-03 15:24:09 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-04-07 12:13:10 +0200
commit2d1d6581eca4508838cd339cc19c72efc42d6ea0 (patch)
tree7bf5a9c7f6094f513eb3d475e83a9ab7439f0302 /src/main.h
parent3bc71e1572cbe2e1f85bd487c77a63c46cf4b5bb (diff)
Track block download times per individual block
Currently, we're keeping a timeout for each requested block, starting from when it is requested, with a correction factor for the number of blocks in the queue. That's unnecessarily complicated and inaccurate. As peers process block requests in order, we can make the timeout for each block start counting only when all previous ones have been received, and have a correction based on the number of peers, rather than the total number of blocks.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.h b/src/main.h
index 3ea9dc500c..68fcf8e7c9 100644
--- a/src/main.h
+++ b/src/main.h
@@ -106,6 +106,10 @@ static const unsigned int AVG_INVENTORY_BROADCAST_INTERVAL = 5;
static const unsigned int AVG_FEEFILTER_BROADCAST_INTERVAL = 10 * 60;
/** Maximum feefilter broadcast delay after significant change. */
static const unsigned int MAX_FEEFILTER_CHANGE_DELAY = 5 * 60;
+/** Block download timeout base, expressed in millionths of the block interval (i.e. 20 min) */
+static const int64_t BLOCK_DOWNLOAD_TIMEOUT_BASE = 2000000;
+/** Additional block download timeout per parallel downloading peer (i.e. 5 min) */
+static const int64_t BLOCK_DOWNLOAD_TIMEOUT_PER_PEER = 500000;
static const unsigned int DEFAULT_LIMITFREERELAY = 15;
static const bool DEFAULT_RELAYPRIORITY = true;