Changeset View
Changeset View
Standalone View
Standalone View
src/interfaces/chain.cpp
Show First 20 Lines • Show All 411 Lines • ▼ Show 20 Lines | public: | ||||
bool havePruned() override { | bool havePruned() override { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
return ::fHavePruned; | return ::fHavePruned; | ||||
} | } | ||||
bool isReadyToBroadcast() override { | bool isReadyToBroadcast() override { | ||||
return !::fImporting && !::fReindex && !isInitialBlockDownload(); | return !::fImporting && !::fReindex && !isInitialBlockDownload(); | ||||
} | } | ||||
bool isInitialBlockDownload() override { | bool isInitialBlockDownload() override { | ||||
const CChainState *active_chainstate; | return chainman().ActiveChainstate().IsInitialBlockDownload(); | ||||
{ | |||||
// TODO: Temporary scope to check correctness of refactored code | |||||
// Should be removed manually after backport of | |||||
// https://github.com/bitcoin/bitcoin/pull/20158 | |||||
LOCK(::cs_main); | |||||
active_chainstate = &chainman().ActiveChainstate(); | |||||
assert(std::addressof(::ChainstateActive()) == | |||||
std::addressof(*active_chainstate)); | |||||
} | |||||
return active_chainstate->IsInitialBlockDownload(); | |||||
} | } | ||||
bool shutdownRequested() override { return ShutdownRequested(); } | bool shutdownRequested() override { return ShutdownRequested(); } | ||||
int64_t getAdjustedTime() override { return GetAdjustedTime(); } | int64_t getAdjustedTime() override { return GetAdjustedTime(); } | ||||
void initMessage(const std::string &message) override { | void initMessage(const std::string &message) override { | ||||
::uiInterface.InitMessage(message); | ::uiInterface.InitMessage(message); | ||||
} | } | ||||
void initWarning(const bilingual_str &message) override { | void initWarning(const bilingual_str &message) override { | ||||
InitWarning(message); | InitWarning(message); | ||||
▲ Show 20 Lines • Show All 81 Lines • Show Last 20 Lines |