rippled
Loading...
Searching...
No Matches
TransactionMaster.h
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#ifndef RIPPLE_APP_LEDGER_TRANSACTIONMASTER_H_INCLUDED
21#define RIPPLE_APP_LEDGER_TRANSACTIONMASTER_H_INCLUDED
22
23#include <xrpld/app/misc/Transaction.h>
24#include <xrpld/shamap/SHAMapItem.h>
25#include <xrpld/shamap/SHAMapTreeNode.h>
26
27#include <xrpl/basics/RangeSet.h>
28#include <xrpl/basics/TaggedCache.h>
29#include <xrpl/protocol/ErrorCodes.h>
30
31namespace ripple {
32
33class Application;
34class STTx;
35
36// Tracks all transactions in memory
37
39{
40public:
44 operator=(TransactionMaster const&) = delete;
45
48
52 fetch(uint256 const&, error_code_i& ec);
53
66 fetch(
67 uint256 const&,
69 error_code_i& ec);
70
72 fetch(
73 boost::intrusive_ptr<SHAMapItem> const& item,
74 SHAMapNodeType type,
75 std::uint32_t uCommitLedger);
76
77 // return value: true = we had the transaction already
78 bool
80 uint256 const& hash,
81 std::uint32_t ledger,
84
85 void
87
88 void
89 sweep(void);
90
92 getCache();
93
94private:
97};
98
99} // namespace ripple
100
101#endif
Map/cache combination.
Definition TaggedCache.h:62
std::shared_ptr< Transaction > fetch_from_cache(uint256 const &)
TransactionMaster(TransactionMaster const &)=delete
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > fetch(uint256 const &, error_code_i &ec)
bool inLedger(uint256 const &hash, std::uint32_t ledger, std::optional< uint32_t > tseq, std::optional< uint32_t > netID)
TransactionMaster & operator=(TransactionMaster const &)=delete
TaggedCache< uint256, Transaction > mCache
void canonicalize(std::shared_ptr< Transaction > *pTransaction)
TaggedCache< uint256, Transaction > & getCache()
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
Definition RangeSet.h:45
ClosedInterval< T > range(T low, T high)
Create a closed range interval.
Definition RangeSet.h:54