20#include <xrpld/app/ledger/TransactionMaster.h>
21#include <xrpld/app/main/Application.h>
22#include <xrpld/app/misc/Transaction.h>
24#include <xrpl/basics/TaggedCache.ipp>
25#include <xrpl/basics/chrono.h>
26#include <xrpl/protocol/STTx.h>
35 std::chrono::minutes{30},
37 mApp.journal(
"TaggedCache"))
48 auto txn =
mCache.fetch(hash);
53 txn->setStatus(
COMMITTED, ledger, tseq, netID);
60 return mCache.fetch(txnID);
72 return std::pair{std::move(txn),
nullptr};
82 mCache.canonicalize_replace_client(txnID, txn);
84 return std::pair{std::move(txn), std::move(txnMeta)};
99 return std::pair{std::move(txn),
nullptr};
109 mCache.canonicalize_replace_client(txnID, txn);
111 return std::pair{std::move(txn), std::move(txnMeta)};
116 boost::intrusive_ptr<SHAMapItem>
const& item,
140 iTx->setStatus(
COMMITTED, uCommitLedger);
142 txn = iTx->getSTransaction();
151 uint256 const tid = (*pTransaction)->getID();
152 if (tid != beast::zero)
154 auto txn = *pTransaction;
156 mCache.canonicalize_replace_client(tid, txn);
std::shared_ptr< Transaction > fetch_from_cache(uint256 const &)
TransactionMaster(Application &app)
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)
TaggedCache< uint256, Transaction > mCache
void canonicalize(std::shared_ptr< Transaction > *pTransaction)
TaggedCache< uint256, Transaction > & getCache()
static std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > load(uint256 const &id, Application &app, error_code_i &ec)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
boost::icl::closed_interval< T > ClosedInterval
A closed interval over the domain T.
Stopwatch & stopwatch()
Returns an instance of a wall clock.
ClosedInterval< T > range(T low, T high)
Create a closed range interval.