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

@@ -85,7 +85,7 @@ TestingSetup::TestingSetup(const std::string& chainName) : BasicTestingSetup(cha
{
CValidationState state;
if (!ActivateBestChain(state, chainparams)) {
throw std::runtime_error("ActivateBestChain failed.");
throw std::runtime_error(strprintf("ActivateBestChain failed. (%s)", FormatStateMessage(state)));
}
}
nScriptCheckThreads = 3;