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