refactoring: IsInitialBlockDownload -> CChainState

We introduce CChainState.m_cached_finished_ibd because the static state it
replaces would've been shared across all CChainState instances.
This commit is contained in:
James O'Beirne
2019-03-27 12:21:50 -04:00
parent 3ccbc376dd
commit 403e677c9e
7 changed files with 41 additions and 29 deletions

View File

@@ -442,7 +442,7 @@ static UniValue getblocktemplate(const JSONRPCRequest& request)
if (g_connman->GetNodeCount(CConnman::CONNECTIONS_ALL) == 0)
throw JSONRPCError(RPC_CLIENT_NOT_CONNECTED, PACKAGE_NAME " is not connected!");
if (IsInitialBlockDownload())
if (::ChainstateActive().IsInitialBlockDownload())
throw JSONRPCError(RPC_CLIENT_IN_INITIAL_DOWNLOAD, PACKAGE_NAME " is in initial sync and waiting for blocks...");
static unsigned int nTransactionsUpdatedLast;