aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.h
diff options
context:
space:
mode:
authorp-j01 <[email protected]>2021-06-13 23:33:42 +0000
committerp-j01 <[email protected]>2021-06-14 00:03:51 +0000
commit4c68245cf79036b2eba493221d93791b98412448 (patch)
treee38791d056117e46d2bd28f8e930062646bea56e /src/net_processing.h
parentMerge pull request #1825 from alamshafil/master (diff)
downloaddiscoin-4c68245cf79036b2eba493221d93791b98412448.tar.xz
discoin-4c68245cf79036b2eba493221d93791b98412448.zip
fix: Disconnect stalling peers after timeout of header sync
Diffstat (limited to 'src/net_processing.h')
-rw-r--r--src/net_processing.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/net_processing.h b/src/net_processing.h
index 9e3f1b715..53ca5e393 100644
--- a/src/net_processing.h
+++ b/src/net_processing.h
@@ -17,7 +17,10 @@ static const int64_t ORPHAN_TX_EXPIRE_TIME = 20 * 60;
static const int64_t ORPHAN_TX_EXPIRE_INTERVAL = 5 * 60;
/** Default number of orphan+recently-replaced txn to keep around for block reconstruction */
static const unsigned int DEFAULT_BLOCK_RECONSTRUCTION_EXTRA_TXN = 100;
-
+/** Headers download timeout expressed in microseconds
+ * Timeout = base + per_header * (expected number of headers) */
+static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_BASE = 15 * 60 * 1000000; // 15 minutes
+static constexpr int64_t HEADERS_DOWNLOAD_TIMEOUT_PER_HEADER = 1000; // 1ms/header
/** Register with a network node to receive its signals */
void RegisterNodeSignals(CNodeSignals& nodeSignals);
/** Unregister a network node */