CatapultServer  v0.5.0.1 (Elephant)
catapult::chain::UtUpdater Class Reference

Provides batch updating of an unconfirmed transactions cache. More...

Classes

class  Impl
 
struct  ThrottleContext
 Contextual information passed to throttle. More...
 

Public Types

enum  TransactionSource { TransactionSource::New, TransactionSource::Reverted, TransactionSource::Existing }
 Sources of transactions that can be updated. More...
 
using Throttle = predicate< const model::TransactionInfo &, const ThrottleContext & >
 Function signature for throttling cache additions. More...
 

Public Member Functions

 UtUpdater (cache::UtCache &transactionsCache, const cache::CatapultCache &confirmedCatapultCache, BlockFeeMultiplier minFeeMultiplier, const ExecutionConfiguration &executionConfig, const TimeSupplier &timeSupplier, const FailedTransactionSink &failedTransactionSink, const Throttle &throttle)
 
 ~UtUpdater ()
 Destroys the updater. More...
 
void update (const std::vector< model::TransactionInfo > &utInfos)
 Updates this cache by applying new transaction infos in utInfos. More...
 
void update (const utils::HashPointerSet &confirmedTransactionHashes, const std::vector< model::TransactionInfo > &utInfos)
 

Private Attributes

std::unique_ptr< Implm_pImpl
 

Detailed Description

Provides batch updating of an unconfirmed transactions cache.

Member Typedef Documentation

◆ Throttle

Function signature for throttling cache additions.

Member Enumeration Documentation

◆ TransactionSource

Sources of transactions that can be updated.

Enumerator
New 

A new transaction that is added for the first time.

Reverted 

A previously committed transaction that was reverted.

Existing 

An existing transaction that is reapplied.

Constructor & Destructor Documentation

◆ UtUpdater()

catapult::chain::UtUpdater::UtUpdater ( cache::UtCache transactionsCache,
const cache::CatapultCache confirmedCatapultCache,
BlockFeeMultiplier  minFeeMultiplier,
const ExecutionConfiguration executionConfig,
const TimeSupplier timeSupplier,
const FailedTransactionSink failedTransactionSink,
const Throttle throttle 
)

Creates an updater around transactionsCache with execution configuration (executionConfig), current time supplier (timeSupplier) and failed transaction sink (failedTransactionSink). confirmedCatapultCache is the real (confirmed) catapult cache. throttle allows throttling (rejection) of transactions. minFeeMultiplier is the minimum fee multiplier of transactions allowed in the cache.

◆ ~UtUpdater()

catapult::chain::UtUpdater::~UtUpdater ( )
default

Destroys the updater.

Member Function Documentation

◆ update() [1/2]

void catapult::chain::UtUpdater::update ( const std::vector< model::TransactionInfo > &  utInfos)

Updates this cache by applying new transaction infos in utInfos.

◆ update() [2/2]

void catapult::chain::UtUpdater::update ( const utils::HashPointerSet confirmedTransactionHashes,
const std::vector< model::TransactionInfo > &  utInfos 
)

Updates this cache by applying new transaction infos in utInfos and removing transactions with hashes in confirmedTransactionHashes.

Member Data Documentation

◆ m_pImpl

std::unique_ptr<Impl> catapult::chain::UtUpdater::m_pImpl
private

The documentation for this class was generated from the following files: