LedgerMaster hash lookups return boost::optional.

This commit is contained in:
Edward Hennis
2015-12-02 16:05:05 -05:00
committed by Nik Bougalis
parent e1018546ac
commit 4d2e7ed404
3 changed files with 42 additions and 35 deletions

View File

@@ -162,11 +162,12 @@ bool isValidated (LedgerMaster& ledgerMaster, ReadView const& ledger,
// validated).
auto hash = ledgerMaster.walkHashBySeq (seq);
if (ledger.info().hash != hash)
if (!hash || ledger.info().hash != *hash)
{
// This ledger's hash is not the hash of the validated ledger
if (hash.isNonZero ())
if (hash)
{
assert(hash->isNonZero());
uint256 valHash = getHashByIndex (seq, app);
if (valHash == ledger.info().hash)
{