aboutsummaryrefslogtreecommitdiff
path: root/src/main.h
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-04-03 15:24:09 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2016-04-07 13:16:16 +0200
commit90f1d246d38803eb546c6652ddce5ebea55eec98 (patch)
tree949d47944a44ef018e736ba1d2c594a4fe443326 /src/main.h
parent4226aacdba7d0e1e22555dac69363b3b460a166b (diff)
downloadbitcoin-90f1d246d38803eb546c6652ddce5ebea55eec98.tar.xz
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. Conflicts: src/main.cpp src/main.h Self check after the last peer is removed Github-Pull: #7804 Rebased-From: 2d1d6581eca4508838cd339cc19c72efc42d6ea0 0e24bbf679c95784ed5514a6a1f2fbf99dd97725
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 47e18eab4d..a89d14cdcb 100644
--- a/src/main.h
+++ b/src/main.h
@@ -98,6 +98,10 @@ static const unsigned int AVG_ADDRESS_BROADCAST_INTERVAL = 30;
/** Average delay between trickled inventory broadcasts in seconds.
* Blocks, whitelisted receivers, and a random 25% of transactions bypass this. */
static const unsigned int AVG_INVENTORY_BROADCAST_INTERVAL = 5;
+/** 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;