node/chainstate: Remove do/while loop

I strongly recommend reviewing with the following git-diff flags:
  --ignore-space-change
This commit is contained in:
Carl Dong 2021-09-20 17:46:06 -04:00
parent 975235ca0a
commit adf4912d77

View File

@ -28,7 +28,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
return fReset || fReindexChainState || chainstate->CoinsTip().GetBestBlock().IsNull();
};
do {
try {
LOCK(cs_main);
chainman.InitializeChainstate(mempool);
@ -161,6 +160,6 @@ std::optional<ChainstateLoadingError> LoadChainstate(bool fReset,
LogPrintf("%s\n", e.what());
return ChainstateLoadingError::ERROR_GENERIC_BLOCKDB_OPEN_FAILED;
}
} while(false);
return std::nullopt;
}