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

@@ -321,8 +321,8 @@ public:
CFeeRate relayDustFee() override { return ::dustRelayFee; }
bool getPruneMode() override { return ::fPruneMode; }
bool p2pEnabled() override { return g_connman != nullptr; }
bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !IsInitialBlockDownload(); }
bool isInitialBlockDownload() override { return IsInitialBlockDownload(); }
bool isReadyToBroadcast() override { return !::fImporting && !::fReindex && !isInitialBlockDownload(); }
bool isInitialBlockDownload() override { return ::ChainstateActive().IsInitialBlockDownload(); }
bool shutdownRequested() override { return ShutdownRequested(); }
int64_t getAdjustedTime() override { return GetAdjustedTime(); }
void initMessage(const std::string& message) override { ::uiInterface.InitMessage(message); }

View File

@@ -197,7 +197,7 @@ public:
}
return GuessVerificationProgress(Params().TxData(), tip);
}
bool isInitialBlockDownload() override { return IsInitialBlockDownload(); }
bool isInitialBlockDownload() override { return ::ChainstateActive().IsInitialBlockDownload(); }
bool getReindex() override { return ::fReindex; }
bool getImporting() override { return ::fImporting; }
void setNetworkActive(bool active) override