Skip to content

Commit

Permalink
Check MAX_TIP_AGE only in mainnet
Browse files Browse the repository at this point in the history
  • Loading branch information
ander7agar committed Jan 18, 2018
1 parent 377aa4c commit 203a528
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1239,10 +1239,13 @@ bool IsInitialBlockDownload()
error("IsInitialBlockDownload: nChainWork < nMinimumChainWork, true");
return true;
}
if (chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge)) {
error("IsInitialBlockDownload: GetBlockTime() < (GetTime() - nMaxTipAge), true");

//Check MAX_TIP_AGE only in mainnet
if (Params().NetworkIDString() == "main" && chainActive.Tip()->GetBlockTime() < (GetTime() - nMaxTipAge)) {
error("IsInitialBlockDownload: GetBlockTime() < (GetTime() - nMaxTipAge), true");
return true;
}

LogPrintf("Leaving InitialBlockDownload (latching to false)\n");
latchToFalse.store(true, std::memory_order_relaxed);
return false;
Expand Down

0 comments on commit 203a528

Please sign in to comment.