From c853471fbc7ea41b7c36e6fafdbbff76789f088f Mon Sep 17 00:00:00 2001 From: furszy Date: Wed, 3 Mar 2021 13:06:40 -0300 Subject: [PATCH] init: shutdown and return early if ActivateBestChain() fails. --- src/init.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/init.cpp b/src/init.cpp index 74bd55904af56..10e6fea7187d4 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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);