diff options
author | Carl Dong <contact@carldong.me> | 2021-08-18 13:39:34 -0400 |
---|---|---|
committer | Carl Dong <contact@carldong.me> | 2021-12-06 16:41:33 -0500 |
commit | b345979a2b03b671c0984edd7e48e0baec2e2f34 (patch) | |
tree | 9b4950b2309eb78dbadb6711c3406205dfb8eff5 /src/init.cpp | |
parent | ca7c0b934db68acdc410e3a82f1ed898382da2e5 (diff) | |
download | bitcoin-b345979a2b03b671c0984edd7e48e0baec2e2f34.tar.xz |
node/chainstate: Decouple from concept of uiInterface
...instead allow the caller to optionally pass in callbacks which are
triggered for certain events.
Behaviour change: The string "Verifying blocks..." was previously
printed for each chainstate in chainman which did not have an
effectively empty coinsview, now it will be printed once unconditionally
before we call VerifyLoadedChain.
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/init.cpp b/src/init.cpp index e52ea57bdb..80f767a431 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1427,7 +1427,12 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) fReindexChainState, nBlockTreeDBCache, nCoinDBCache, - nCoinCacheUsage); + nCoinCacheUsage, + []() { + uiInterface.ThreadSafeMessageBox( + _("Error reading from database, shutting down."), + "", CClientUIInterface::MSG_ERROR); + }); if (rv.has_value()) { switch (rv.value()) { case ChainstateLoadingError::ERROR_LOADING_BLOCK_DB: @@ -1463,6 +1468,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info) break; } } else { + uiInterface.InitMessage(_("Verifying blocks…").translated); auto rv2 = VerifyLoadedChainstate(chainman, fReset, fReindexChainState, |