xrpld
Loading...
Searching...
No Matches
LedgerPersistence.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/ledger/Ledger.h>
5#include <xrpl/protocol/LedgerHeader.h>
6#include <xrpl/protocol/Rules.h>
7
8#include <cstdint>
9#include <memory>
10#include <tuple>
11
12namespace xrpl {
13
14class ServiceRegistry;
15struct Fees;
16
27bool
29 ServiceRegistry& registry,
30 std::shared_ptr<Ledger const> const& ledger,
31 bool isSynchronous,
32 bool isCurrent);
33
44std::shared_ptr<Ledger>
46 LedgerHeader const& info,
47 Rules const& rules,
48 Fees const& fees,
49 ServiceRegistry& registry,
50 bool acquire);
51
62std::shared_ptr<Ledger>
64 std::uint32_t ledgerIndex,
65 Rules const& rules,
66 Fees const& fees,
67 ServiceRegistry& registry,
68 bool acquire = true);
69
80std::shared_ptr<Ledger>
82 uint256 const& ledgerHash,
83 Rules const& rules,
84 Fees const& fees,
85 ServiceRegistry& registry,
86 bool acquire = true);
87
96std::tuple<std::shared_ptr<Ledger>, std::uint32_t, uint256>
97getLatestLedger(Rules const& rules, Fees const& fees, ServiceRegistry& registry);
98
99} // namespace xrpl
Rules controlling protocol behavior.
Definition Rules.h:40
Service registry for dependency injection.
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.
std::shared_ptr< Ledger > loadByHash(uint256 const &ledgerHash, Rules const &rules, Fees const &fees, ServiceRegistry &registry, bool acquire)
Load a ledger by its hash.
BaseUInt< 256 > uint256
Definition base_uint.h:580
Reflects the fee settings for a particular ledger.
Information about the notional ledger backing the view.