rippled
Loading...
Searching...
No Matches
LocalTxs.h
1#pragma once
2
3#include <xrpld/app/misc/CanonicalTXSet.h>
4
5#include <xrpl/ledger/ReadView.h>
6
7#include <memory>
8
9namespace xrpl {
10
11// Track transactions issued by local clients
12// Ensure we always apply them to our open ledger
13// Hold them until we see them in a fully-validated ledger
14
16{
17public:
18 // The number of ledgers to hold a transaction is essentially
19 // arbitrary. It should be sufficient to allow the transaction to
20 // get into a fully-validated ledger.
21 static constexpr int holdLedgers = 5;
22
23 virtual ~LocalTxs() = default;
24
25 // Add a new local transaction
26 virtual void
28
29 // Return the set of local transactions to a new open ledger
30 virtual CanonicalTXSet
31 getTxSet() = 0;
32
33 // Remove obsolete transactions based on a new fully-valid ledger
34 virtual void
35 sweep(ReadView const& view) = 0;
36
37 virtual std::size_t
38 size() = 0;
39};
40
43
44} // namespace xrpl
Holds transactions which were deferred to the next pass of consensus.
static constexpr int holdLedgers
Definition LocalTxs.h:21
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:170