20 #include <ripple/app/ledger/TransactionMaster.h>
21 #include <ripple/app/misc/Transaction.h>
22 #include <ripple/app/main/Application.h>
23 #include <ripple/protocol/STTx.h>
24 #include <ripple/basics/chrono.h>
30 , mCache (
"TransactionCache", 65536,
std::chrono::minutes {30},
stopwatch(),
31 mApp.journal(
"TaggedCache"))
37 auto txn =
mCache.fetch (hash);
49 return mCache.fetch (txnID);
65 mCache.canonicalize_replace_client(txnID, txn);
70 boost::variant<Transaction::pointer, bool>
76 auto txn =
mCache.fetch (txnID);
84 if (v.which () == 0 && boost::get<pointer> (v))
85 mCache.canonicalize_replace_client(txnID, boost::get<pointer> (v));
103 txn = std::make_shared<STTx const> (
std::ref (sit));
107 auto blob =
SerialIter{item->data(), item->size()}.getVL();
108 txn = std::make_shared<STTx const>(
SerialIter{blob.data(), blob.size()});
114 iTx->setStatus (
COMMITTED, uCommitLedger);
116 txn = iTx->getSTransaction ();
125 uint256 const tid = (*pTransaction)->getID();
126 if (tid != beast::zero)
128 auto txn = *pTransaction;
130 mCache.canonicalize_replace_client(tid, txn);