Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Blockcore/Base/InitialBlockDownloadState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ public InitialBlockDownloadState(IChainState chainState, Network network, Consen
/// <inheritdoc />
public bool IsInitialBlockDownload()
{
// The HTTP server starts up before the blockchain database is loaded, this means ConsensusTip can at startup be null. Simply
// return IBD as true if ConsensusTip is null.
if (this.chainState.ConsensusTip == null)
{
return true;
}

if (this.lastCheckpointHeight > this.chainState.ConsensusTip.Height)
return true;

Expand All @@ -67,4 +74,4 @@ public bool IsInitialBlockDownload()
return false;
}
}
}
}