rippled
Loading...
Searching...
No Matches
LocalTxs.h
1#pragma once
2
3#include <xrpl/ledger/CanonicalTXSet.h>
4#include <xrpl/ledger/ReadView.h>
5
6#include <memory>
7
8namespace xrpl {
9
10// Track transactions issued by local clients
11// Ensure we always apply them to our open ledger
12// Hold them until we see them in a fully-validated ledger
13
15{
16public:
17 // The number of ledgers to hold a transaction is essentially
18 // arbitrary. It should be sufficient to allow the transaction to
19 // get into a fully-validated ledger.
20 static constexpr int holdLedgers = 5;
21
22 virtual ~LocalTxs() = default;
23
24 // Add a new local transaction
25 virtual void
27
28 // Return the set of local transactions to a new open ledger
29 virtual CanonicalTXSet
30 getTxSet() = 0;
31
32 // Remove obsolete transactions based on a new fully-valid ledger
33 virtual void
34 sweep(ReadView const& view) = 0;
35
36 virtual std::size_t
37 size() = 0;
38};
39
42
43} // namespace xrpl
Holds transactions which were deferred to the next pass of consensus.
static constexpr int holdLedgers
Definition LocalTxs.h:20
virtual void push_back(LedgerIndex index, std::shared_ptr< STTx const > const &txn)=0
virtual void sweep(ReadView const &view)=0
virtual ~LocalTxs()=default
virtual std::size_t size()=0
virtual CanonicalTXSet getTxSet()=0
A view into a ledger.
Definition ReadView.h:31
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
std::unique_ptr< LocalTxs > make_LocalTxs()
Definition LocalTxs.cpp:172