1#include <xrpld/app/ledger/TransactionMaster.h>
2#include <xrpld/app/main/Application.h>
3#include <xrpld/app/misc/Transaction.h>
5#include <xrpl/basics/TaggedCache.ipp>
6#include <xrpl/basics/chrono.h>
7#include <xrpl/protocol/STTx.h>
16 std::chrono::minutes{30},
18 mApp.journal(
"TaggedCache"))
29 auto txn =
mCache.fetch(hash);
34 txn->setStatus(
COMMITTED, ledger, tseq, netID);
41 return mCache.fetch(txnID);
53 return std::pair{std::move(txn),
nullptr};
63 mCache.canonicalize_replace_client(txnID, txn);
65 return std::pair{std::move(txn), std::move(txnMeta)};
80 return std::pair{std::move(txn),
nullptr};
90 mCache.canonicalize_replace_client(txnID, txn);
92 return std::pair{std::move(txn), std::move(txnMeta)};
97 boost::intrusive_ptr<SHAMapItem>
const& item,
121 iTx->setStatus(
COMMITTED, uCommitLedger);
123 txn = iTx->getSTransaction();
132 uint256 const tid = (*pTransaction)->getID();
133 if (tid != beast::zero)
135 auto txn = *pTransaction;
137 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.