Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update InitialBlockDownloadState.cs #452

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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 @@
/// <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;
}

Check warning on line 64 in src/Blockcore/Base/InitialBlockDownloadState.cs

View workflow job for this annotation

GitHub Actions / buildAndUnitTest (windows-latest)

Check warning on line 64 in src/Blockcore/Base/InitialBlockDownloadState.cs

View workflow job for this annotation

GitHub Actions / buildAndUnitTest (ubuntu-latest)

Check warning on line 64 in src/Blockcore/Base/InitialBlockDownloadState.cs

View workflow job for this annotation

GitHub Actions / buildAndUnitTest (macos-latest)

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

Expand All @@ -67,4 +74,4 @@
return false;
}
}
}
}
Loading