Hotfix for account_info, ledger_data and ip() (#134)

* remove option to create account from seed

* catch errors in derived().ip()

* checks keys.size() before accessing
This commit is contained in:
Nathan Nichols
2022-03-25 15:57:32 -05:00
committed by GitHub
parent ac6c4c25d6
commit e526083456
8 changed files with 76 additions and 43 deletions

View File

@@ -253,9 +253,8 @@ BackendInterface::fetchLedgerPage(
bool reachedEnd = false;
while (keys.size() < limit && !reachedEnd)
{
ripple::uint256 const& curCursor = keys.size() ? keys.back()
: cursor ? *cursor
: firstKey;
ripple::uint256 const& curCursor =
keys.size() ? keys.back() : cursor ? *cursor : firstKey;
uint32_t seq = outOfOrder ? range->maxSequence : ledgerSequence;
auto succ = fetchSuccessorKey(curCursor, seq, yield);
if (!succ)
@@ -283,7 +282,7 @@ BackendInterface::fetchLedgerPage(
assert(false);
}
}
if (!reachedEnd)
if (keys.size() && !reachedEnd)
page.cursor = keys.back();
return page;