Reduce (ab)use of exceptions.

This commit is contained in:
JoelKatz
2013-06-11 16:55:23 -07:00
parent 46e31c425d
commit d1af075b29
5 changed files with 74 additions and 83 deletions

View File

@@ -65,27 +65,15 @@ Ledger::Ledger (uint256 const& parentHash,
updateHash();
loaded = true;
try
{
if (mTransHash.isNonZero())
mTransactionMap->fetchRoot(mTransHash, NULL);
}
catch (...)
if (mTransHash.isNonZero() && !mTransactionMap->fetchRoot(mTransHash, NULL))
{
loaded = false;
WriteLog (lsWARNING, Ledger) << "Don't have TX root for ledger";
}
try
{
if (mAccountHash.isNonZero())
mAccountStateMap->fetchRoot(mAccountHash, NULL);
}
catch (...)
if (mAccountHash.isNonZero() && !mAccountStateMap->fetchRoot(mAccountHash, NULL))
{
loaded = false;
WriteLog (lsWARNING, Ledger) << "Don't have AS root for ledger";
}