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#include <xrpl/basics/RangeSet.h>
27#include <xrpl/protocol/ErrorCodes.h>
28
29namespace ripple {
30
31class Application;
32class STTx;
33
34// Tracks all transactions in memory
35
37{
38public:
42 operator=(TransactionMaster const&) = delete;
43
46
50 fetch(uint256 const&, error_code_i& ec);
51
64 fetch(
65 uint256 const&,
67 error_code_i& ec);
68
70 fetch(
71 boost::intrusive_ptr<SHAMapItem> const& item,
72 SHAMapNodeType type,
73 std::uint32_t uCommitLedger);
74
75 // return value: true = we had the transaction already
76 bool
77 inLedger(uint256 const& hash, std::uint32_t ledger);
78
79 void
81
82 void
83 sweep(void);
84
86 getCache();
87
88private:
91};
92
93} // namespace ripple
94
95#endif
Map/cache combination.
Definition: TaggedCache.h:57
std::shared_ptr< Transaction > fetch_from_cache(uint256 const &)
bool inLedger(uint256 const &hash, std::uint32_t ledger)
TransactionMaster(TransactionMaster const &)=delete
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > fetch(uint256 const &, error_code_i &ec)
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:26
error_code_i
Definition: ErrorCodes.h:40
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