Consistently log CValidationState on failure

Seems providing at least minimal visibility to the failure is a good practice.

The only remaining ignored state is in LoadExternalBlockFile, where logging
would likely be spammy.
This commit is contained in:
Ben Woosley
2018-04-18 09:58:13 -04:00
parent 615f7c2884
commit e4d0b44373
4 changed files with 29 additions and 15 deletions

View File

@@ -684,7 +684,7 @@ void ThreadImport(std::vector<fs::path> vImportFiles)
// scan for better chains in the block chain database, that are not yet connected in the active best chain
CValidationState state;
if (!ActivateBestChain(state, chainparams)) {
LogPrintf("Failed to connect best block\n");
LogPrintf("Failed to connect best block (%s)\n", FormatStateMessage(state));
StartShutdown();
return;
}