xrpld
Loading...
Searching...
No Matches
TransactionMaster.h
1#pragma once
2
3#include <xrpld/app/misc/Transaction.h>
4
5#include <xrpl/basics/RangeSet.h>
6#include <xrpl/basics/TaggedCache.h>
7#include <xrpl/basics/base_uint.h>
8#include <xrpl/protocol/ErrorCodes.h>
9#include <xrpl/protocol/TxMeta.h>
10#include <xrpl/protocol/TxSearched.h>
11#include <xrpl/shamap/SHAMapItem.h>
12#include <xrpl/shamap/SHAMapTreeNode.h>
13
14#include <cstdint>
15#include <memory>
16#include <optional>
17#include <utility>
18#include <variant>
19
20namespace xrpl {
21
22class Application;
23class STTx;
24
25// Tracks all transactions in memory
26
28{
29public:
33 operator=(TransactionMaster const&) = delete;
34
36 fetchFromCache(uint256 const&);
37
39 fetch(uint256 const&, ErrorCodeI& ec);
40
52
54 fetch(
55 boost::intrusive_ptr<SHAMapItem> const& item,
56 SHAMapNodeType type,
57 std::uint32_t uCommitLedger);
58
59 // return value: true = we had the transaction already
60 bool
62 uint256 const& hash,
63 std::uint32_t ledger,
66
67 void
69
70 void
71 sweep();
72
74 getCache();
75
76private:
79};
80
81} // namespace xrpl
Map/cache combination.
Definition TaggedCache.h:67
TaggedCache< uint256, Transaction > cache_
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > fetch(uint256 const &, ErrorCodeI &ec)
TransactionMaster(TransactionMaster const &)=delete
bool inLedger(uint256 const &hash, std::uint32_t ledger, std::optional< uint32_t > tseq, std::optional< uint32_t > netID)
TransactionMaster(Application &app)
void canonicalize(std::shared_ptr< Transaction > *pTransaction)
TaggedCache< uint256, Transaction > & getCache()
TransactionMaster & operator=(TransactionMaster const &)=delete
std::shared_ptr< Transaction > fetchFromCache(uint256 const &)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
ErrorCodeI
Definition ErrorCodes.h:23
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:37
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
Definition RangeSet.h:27
TxSearched
Definition TxSearched.h:5
BaseUInt< 256 > uint256
Definition base_uint.h:580