Fix marker issue (#518)

* Fixes #515
This commit is contained in:
cyan317
2023-02-21 13:48:52 +00:00
committed by GitHub
parent 9fa26be13a
commit 739807a7d7
6 changed files with 495 additions and 12 deletions

View File

@@ -680,6 +680,8 @@ traverseOwnedNodes(
auto const rootIndex = owner;
auto currentIndex = rootIndex;
// track the current page we are accessing, will return it as the next hint
auto currentPage = startHint;
std::vector<ripple::uint256> keys;
// Only reserve 2048 nodes when fetching all owned ledger objects. If there
@@ -742,18 +744,18 @@ traverseOwnedNodes(
}
}
auto const uNodeNext = sle.getFieldU64(ripple::sfIndexNext);
if (limit == 0)
{
cursor = AccountCursor({keys.back(), uNodeNext});
cursor = AccountCursor({keys.back(), currentPage});
break;
}
// the next page
auto const uNodeNext = sle.getFieldU64(ripple::sfIndexNext);
if (uNodeNext == 0)
break;
currentIndex = ripple::keylet::page(rootIndex, uNodeNext);
currentPage = uNodeNext;
}
}
else
@@ -777,18 +779,18 @@ traverseOwnedNodes(
break;
}
auto const uNodeNext = sle.getFieldU64(ripple::sfIndexNext);
if (limit == 0)
{
cursor = AccountCursor({keys.back(), uNodeNext});
cursor = AccountCursor({keys.back(), currentPage});
break;
}
auto const uNodeNext = sle.getFieldU64(ripple::sfIndexNext);
if (uNodeNext == 0)
break;
currentIndex = ripple::keylet::page(rootIndex, uNodeNext);
currentPage = uNodeNext;
}
}
auto end = std::chrono::system_clock::now();