diff --git a/src/Blockcore/Base/InitialBlockDownloadState.cs b/src/Blockcore/Base/InitialBlockDownloadState.cs index 7a54f6aaa..6f7c0a6e2 100644 --- a/src/Blockcore/Base/InitialBlockDownloadState.cs +++ b/src/Blockcore/Base/InitialBlockDownloadState.cs @@ -55,6 +55,13 @@ public InitialBlockDownloadState(IChainState chainState, Network network, Consen /// 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; @@ -67,4 +74,4 @@ public bool IsInitialBlockDownload() return false; } } -} \ No newline at end of file +}