return null when successor not in object table (#142)

* return null when successor not in object table
This commit is contained in:
Nathan Nichols
2022-04-22 11:40:41 -05:00
committed by GitHub
parent c57b2d89f0
commit 56c36a07a2

View File

@@ -140,7 +140,9 @@ BackendInterface::fetchSuccessorObject(
if (succ) if (succ)
{ {
auto obj = fetchLedgerObject(*succ, ledgerSequence, yield); auto obj = fetchLedgerObject(*succ, ledgerSequence, yield);
assert(obj); if (!obj)
return {{*succ, {}}};
return {{*succ, *obj}}; return {{*succ, *obj}};
} }
return {}; return {};
@@ -176,7 +178,7 @@ BackendInterface::fetchBookOffers(
auto mid2 = std::chrono::system_clock::now(); auto mid2 = std::chrono::system_clock::now();
numSucc++; numSucc++;
succMillis += getMillis(mid2 - mid1); succMillis += getMillis(mid2 - mid1);
if (!offerDir || offerDir->key > bookEnd) if (!offerDir || offerDir->key >= bookEnd)
{ {
BOOST_LOG_TRIVIAL(debug) << __func__ << " - offerDir.has_value() " BOOST_LOG_TRIVIAL(debug) << __func__ << " - offerDir.has_value() "
<< offerDir.has_value() << " breaking"; << offerDir.has_value() << " breaking";