This commit is contained in:
CJ Cobb
2021-07-02 15:05:46 +00:00
parent 9f8724b7ab
commit 2eec383b35
3 changed files with 49 additions and 42 deletions

View File

@@ -205,6 +205,7 @@ BackendInterface::fetchLedgerPage(
uint32_t adjustedLimit = std::max(limitHint, std::max(limit, (uint32_t)4));
LedgerPage page;
page.cursor = cursor;
int numCalls = 0;
do
{
adjustedLimit = adjustedLimit >= 8192 ? 8192 : adjustedLimit * 2;
@@ -223,7 +224,7 @@ BackendInterface::fetchLedgerPage(
page.objects.insert(
page.objects.end(), partial.objects.begin(), partial.objects.end());
page.cursor = partial.cursor;
} while (page.objects.size() < limit && page.cursor);
} while (page.objects.size() < limit && page.cursor && ++numCalls < 10);
if (incomplete)
{
auto rng = fetchLedgerRange();