mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
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.
This commit is contained in:
parent
ca7c0b934d
commit
b345979a2b
3 changed files with 15 additions and 10 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue