Skip to content

Commit

Permalink
init: shutdown and return early if ActivateBestChain() fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Mar 3, 2021
1 parent 1961163 commit c853471
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1793,8 +1793,11 @@ bool AppInitMain()

// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
if (!ActivateBestChain(state))
if (!ActivateBestChain(state)) {
strErrors << "Failed to connect best block";
StartShutdown();
return false;
}
// update g_best_block if needed
{
LOCK(g_best_block_mutex);
Expand Down

0 comments on commit c853471

Please sign in to comment.