rippled
Loading...
Searching...
No Matches
LedgerPersistence.h
1#pragma once
2
3#include <xrpl/ledger/Ledger.h>
4
5#include <memory>
6#include <tuple>
7
8namespace xrpl {
9
10class ServiceRegistry;
11struct Fees;
12
22bool
24 ServiceRegistry& registry,
26 bool isSynchronous,
27 bool isCurrent);
28
40 LedgerHeader const& info,
41 Rules const& rules,
42 Fees const& fees,
43 ServiceRegistry& registry,
44 bool acquire);
45
57 std::uint32_t ledgerIndex,
58 Rules const& rules,
59 Fees const& fees,
60 ServiceRegistry& registry,
61 bool acquire = true);
62
74 uint256 const& ledgerHash,
75 Rules const& rules,
76 Fees const& fees,
77 ServiceRegistry& registry,
78 bool acquire = true);
79
88getLatestLedger(Rules const& rules, Fees const& fees, ServiceRegistry& registry);
89
90} // namespace xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::tuple< std::shared_ptr< Ledger >, std::uint32_t, uint256 > getLatestLedger(Rules const &rules, Fees const &fees, ServiceRegistry &registry)
Fetch the ledger with the highest sequence contained in the database.
bool isCurrent(ValidationParms const &p, NetClock::time_point now, NetClock::time_point signTime, NetClock::time_point seenTime)
Whether a validation is still current.
bool pendSaveValidated(ServiceRegistry &registry, std::shared_ptr< Ledger const > const &ledger, bool isSynchronous, bool isCurrent)
Save, or arrange to save, a fully-validated ledger.
std::shared_ptr< Ledger > loadLedgerHelper(LedgerHeader const &info, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Make ledger using info loaded from database.
std::shared_ptr< Ledger > loadByIndex(std::uint32_t ledgerIndex, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Load a ledger by its sequence number.
base_uint< 256 > uint256
Definition base_uint.h:531
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Load a ledger by its hash.