xrpld
Loading...
Searching...
No Matches
AcceptedLedger.h
1#pragma once
2
3#include <xrpl/basics/CountedObject.h>
4#include <xrpl/core/ServiceRegistry.h>
5#include <xrpl/ledger/AcceptedLedgerTx.h>
6
7namespace xrpl {
8
17/* VFALCO TODO digest this terminology clarification:
18 Closed and accepted refer to ledgers that have not passed the
19 validation threshold yet. Once they pass the threshold, they are
20 "Validated". Closed just means its close time has passed and no
21 new transactions can get in. "Accepted" means we believe it to be
22 the result of the a consensus process (though haven't validated
23 it yet).
24*/
25class AcceptedLedger : public CountedObject<AcceptedLedger>
26{
27public:
29
30 [[nodiscard]] std::shared_ptr<ReadView const> const&
31 getLedger() const
32 {
33 return ledger_;
34 }
35
36 [[nodiscard]] std::size_t
37 size() const
38 {
39 return transactions_.size();
40 }
41
42 [[nodiscard]] auto
43 begin() const
44 {
45 return transactions_.begin();
46 }
47
48 [[nodiscard]] auto
49 end() const
50 {
51 return transactions_.end();
52 }
53
54private:
57};
58
59} // namespace xrpl
std::vector< std::unique_ptr< AcceptedLedgerTx > > transactions_
std::shared_ptr< ReadView const > ledger_
AcceptedLedger(std::shared_ptr< ReadView const > ledger)
std::shared_ptr< ReadView const > const & getLedger() const
std::size_t size() const
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5