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