CatapultServer
v0.5.0.1 (Elephant)
|
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< Impl > | m_pImpl |
Provides batch updating of an unconfirmed transactions cache.
using catapult::chain::UtUpdater::Throttle = predicate<const model::TransactionInfo&, const ThrottleContext&> |
Function signature for throttling cache additions.
|
strong |
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.
|
default |
Destroys the updater.
void catapult::chain::UtUpdater::update | ( | const std::vector< model::TransactionInfo > & | utInfos | ) |
Updates this cache by applying new transaction infos in utInfos.
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.
|
private |