xrpld
Loading...
Searching...
No Matches
xrpl::TransactionMaster Class Reference

#include <TransactionMaster.h>

Collaboration diagram for xrpl::TransactionMaster:

Public Member Functions

 TransactionMaster (Application &app)
 TransactionMaster (TransactionMaster const &)=delete
TransactionMasteroperator= (TransactionMaster const &)=delete
std::shared_ptr< TransactionfetchFromCache (uint256 const &)
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearchedfetch (uint256 const &, ErrorCodeI &ec)
std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearchedfetch (uint256 const &, ClosedInterval< uint32_t > const &range, ErrorCodeI &ec)
 Fetch transaction from the cache or database.
std::shared_ptr< STTx const > fetch (boost::intrusive_ptr< SHAMapItem > const &item, SHAMapNodeType type, std::uint32_t uCommitLedger)
bool inLedger (uint256 const &hash, std::uint32_t ledger, std::optional< uint32_t > tseq, std::optional< uint32_t > netID)
void canonicalize (std::shared_ptr< Transaction > *pTransaction)
void sweep (void)
TaggedCache< uint256, Transaction > & getCache ()

Private Attributes

Applicationapp_
TaggedCache< uint256, Transactioncache_

Detailed Description

Definition at line 18 of file TransactionMaster.h.

Constructor & Destructor Documentation

◆ TransactionMaster() [1/2]

xrpl::TransactionMaster::TransactionMaster ( Application & app)

Definition at line 30 of file TransactionMaster.cpp.

◆ TransactionMaster() [2/2]

xrpl::TransactionMaster::TransactionMaster ( TransactionMaster const & )
delete

Member Function Documentation

◆ operator=()

TransactionMaster & xrpl::TransactionMaster::operator= ( TransactionMaster const & )
delete

◆ fetchFromCache()

std::shared_ptr< Transaction > xrpl::TransactionMaster::fetchFromCache ( uint256 const & txnID)

Definition at line 58 of file TransactionMaster.cpp.

◆ fetch() [1/3]

std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > xrpl::TransactionMaster::fetch ( uint256 const & txnID,
ErrorCodeI & ec )

Definition at line 64 of file TransactionMaster.cpp.

◆ fetch() [2/3]

std::variant< std::pair< std::shared_ptr< Transaction >, std::shared_ptr< TxMeta > >, TxSearched > xrpl::TransactionMaster::fetch ( uint256 const & txnID,
ClosedInterval< uint32_t > const & range,
ErrorCodeI & ec )

Fetch transaction from the cache or database.

Returns
A std::variant that contains either a pair of shared_pointer to the retrieved transaction and its metadata or an enum indicating whether or not the all ledgers in the provided range were present in the database while the search was conducted.

Definition at line 85 of file TransactionMaster.cpp.

◆ fetch() [3/3]

std::shared_ptr< STTx const > xrpl::TransactionMaster::fetch ( boost::intrusive_ptr< SHAMapItem > const & item,
SHAMapNodeType type,
std::uint32_t uCommitLedger )

Definition at line 109 of file TransactionMaster.cpp.

◆ inLedger()

bool xrpl::TransactionMaster::inLedger ( uint256 const & hash,
std::uint32_t ledger,
std::optional< uint32_t > tseq,
std::optional< uint32_t > netID )

Definition at line 42 of file TransactionMaster.cpp.

◆ canonicalize()

void xrpl::TransactionMaster::canonicalize ( std::shared_ptr< Transaction > * pTransaction)

Definition at line 142 of file TransactionMaster.cpp.

◆ sweep()

void xrpl::TransactionMaster::sweep ( void )

Definition at line 155 of file TransactionMaster.cpp.

◆ getCache()

TaggedCache< uint256, Transaction > & xrpl::TransactionMaster::getCache ( )

Definition at line 161 of file TransactionMaster.cpp.

Member Data Documentation

◆ app_

Application& xrpl::TransactionMaster::app_
private

Definition at line 68 of file TransactionMaster.h.

◆ cache_

TaggedCache<uint256, Transaction> xrpl::TransactionMaster::cache_
private

Definition at line 69 of file TransactionMaster.h.