aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 11:55:52 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2016-01-18 11:55:59 +0100
commit47c5ed19f3ba2a5f91f773ce7ff485f8574b570b (patch)
tree412c19c917adee9d43d91e03eb9e2b86eeb228b6 /src/main.cpp
parentc851d8d71b2ee2a942a6b9041b9c0e4f5b836ec5 (diff)
parent64360f13044125fbb3cdcbe2e5e8f2bfb82a8b27 (diff)
downloadbitcoin-47c5ed19f3ba2a5f91f773ce7ff485f8574b570b.tar.xz
Merge pull request #7208
64360f1 Make max tip age an option instead of chainparam (Wladimir J. van der Laan)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 06374cc1b6..2ba2050a15 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -75,6 +75,9 @@ bool fCheckpointsEnabled = DEFAULT_CHECKPOINTS_ENABLED;
size_t nCoinCacheUsage = 5000 * 300;
uint64_t nPruneTarget = 0;
bool fAlerts = DEFAULT_ALERTS;
+/* If the tip is older than this (in seconds), the node is considered to be in initial block download.
+ */
+int64_t nMaxTipAge = DEFAULT_MAX_TIP_AGE;
/** Fees smaller than this (in satoshi) are considered zero fee (for relaying, mining and transaction creation) */
CFeeRate minRelayTxFee = CFeeRate(DEFAULT_MIN_RELAY_TX_FEE);
@@ -1377,7 +1380,7 @@ bool IsInitialBlockDownload()
if (lockIBDState)
return false;
bool state = (chainActive.Height() < pindexBestHeader->nHeight - 24 * 6 ||
- pindexBestHeader->GetBlockTime() < GetTime() - chainParams.MaxTipAge());
+ pindexBestHeader->GetBlockTime() < GetTime() - nMaxTipAge);
if (!state)
lockIBDState = true;
return state;