mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-22 04:35:50 +00:00
fix account_tx iteration
This commit is contained in:
@@ -55,14 +55,14 @@ BackendInterface::writeLedgerObject(
|
||||
std::move(book));
|
||||
}
|
||||
std::optional<LedgerRange>
|
||||
BackendInterface::fetchLedgerRangeNoThrow() const
|
||||
BackendInterface::hardFetchLedgerRangeNoThrow() const
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(warning) << __func__;
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
return fetchLedgerRange();
|
||||
return hardFetchLedgerRange();
|
||||
}
|
||||
catch (DatabaseTimeout& t)
|
||||
{
|
||||
@@ -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,8 +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();
|
||||
@@ -278,7 +278,7 @@ BackendInterface::fetchLedgerPage(
|
||||
void
|
||||
BackendInterface::checkFlagLedgers() const
|
||||
{
|
||||
auto rng = fetchLedgerRangeNoThrow();
|
||||
auto rng = hardFetchLedgerRangeNoThrow();
|
||||
if (rng)
|
||||
{
|
||||
bool prevComplete = true;
|
||||
|
||||
Reference in New Issue
Block a user