mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-21 04:05:51 +00:00
fix account_tx iteration
This commit is contained in:
@@ -66,6 +66,7 @@ class BackendInterface
|
||||
protected:
|
||||
mutable BackendIndexer indexer_;
|
||||
mutable bool isFirst_ = true;
|
||||
mutable std::optional<LedgerRange> range;
|
||||
|
||||
public:
|
||||
BackendInterface(boost::json::object const& config) : indexer_(config)
|
||||
@@ -97,16 +98,15 @@ public:
|
||||
virtual std::optional<uint32_t>
|
||||
fetchLatestLedgerSequence() const = 0;
|
||||
|
||||
virtual std::optional<LedgerRange>
|
||||
fetchLedgerRange() const = 0;
|
||||
std::optional<LedgerRange>
|
||||
fetchLedgerRange() const
|
||||
{
|
||||
return range;
|
||||
}
|
||||
|
||||
std::optional<ripple::Fees>
|
||||
fetchFees(std::uint32_t seq) const;
|
||||
|
||||
// Doesn't throw DatabaseTimeout. Should be used with care.
|
||||
std::optional<LedgerRange>
|
||||
fetchLedgerRangeNoThrow() const;
|
||||
|
||||
// *** transaction methods
|
||||
virtual std::optional<TransactionAndMetadata>
|
||||
fetchTransaction(ripple::uint256 const& hash) const = 0;
|
||||
@@ -174,6 +174,20 @@ protected:
|
||||
friend std::shared_ptr<BackendInterface>
|
||||
make_Backend(boost::json::object const& config);
|
||||
friend class ::BackendTest_Basic_Test;
|
||||
virtual std::optional<LedgerRange>
|
||||
hardFetchLedgerRange() const = 0;
|
||||
// Doesn't throw DatabaseTimeout. Should be used with care.
|
||||
std::optional<LedgerRange>
|
||||
hardFetchLedgerRangeNoThrow() const;
|
||||
|
||||
void
|
||||
updateRange(uint32_t newMax)
|
||||
{
|
||||
if (!range)
|
||||
range = {newMax, newMax};
|
||||
else
|
||||
range->maxSequence = newMax;
|
||||
}
|
||||
|
||||
virtual void
|
||||
writeLedger(
|
||||
|
||||
Reference in New Issue
Block a user