CatapultServer  v0.5.0.1 (Elephant)
TransactionSpamThrottle.h
Go to the documentation of this file.
1 
21 #pragma once
23 
24 namespace catapult { namespace sync {
25 
28  public:
31  : TotalImportance(0)
32  , MaxCacheSize(0)
33  , MaxBlockSize(0)
34  {}
35 
37  SpamThrottleConfiguration(Amount maxBoostFee, Importance totalImportance, uint32_t maxCacheSize, uint32_t maxBlockSize)
38  : MaxBoostFee(maxBoostFee)
39  , TotalImportance(totalImportance)
40  , MaxCacheSize(maxCacheSize)
41  , MaxBlockSize(maxBlockSize)
42  {}
43 
44  public:
47 
50 
52  uint32_t MaxCacheSize;
53 
55  uint32_t MaxBlockSize;
56  };
57 
61  const SpamThrottleConfiguration& config,
62  const predicate<const model::Transaction&>& isBonded);
63 }}
Transaction.h
catapult::chain::UtUpdater::TransactionSource::Reverted
A previously committed transaction that was reverted.
catapult::Amount
utils::BaseValue< uint64_t, Amount_tag > Amount
Definition: src/catapult/types.h:76
UtUpdater.h
catapult::predicate
std::function< bool(TArgs...)> predicate
A predicate function.
Definition: functions.h:31
catapult::sync::SpamThrottleConfiguration::MaxBoostFee
Amount MaxBoostFee
Max fee for boosting importance.
Definition: TransactionSpamThrottle.h:46
m_isBonded
predicate< const model::Transaction & > m_isBonded
Definition: TransactionSpamThrottle.cpp:85
catapult::Importance
utils::BaseValue< uint64_t, Importance_tag > Importance
Definition: src/catapult/types.h:102
catapult::sync::SpamThrottleConfiguration::MaxBlockSize
uint32_t MaxBlockSize
Maximum block size.
Definition: TransactionSpamThrottle.h:55
catapult::utils::BasicBaseValue::unwrap
constexpr ValueType unwrap() const
Unwraps this value and returns the underlying raw value.
Definition: BaseValue.h:53
catapult::sync::SpamThrottleConfiguration::MaxCacheSize
uint32_t MaxCacheSize
Maximum transactions cache size.
Definition: TransactionSpamThrottle.h:52
catapult::utils::BaseValue< uint64_t, Amount_tag >
catapult::chain::UtUpdater::Throttle
predicate< const model::TransactionInfo &, const ThrottleContext & > Throttle
Function signature for throttling cache additions.
Definition: UtUpdater.h:69
catapult::sync::SpamThrottleConfiguration::SpamThrottleConfiguration
SpamThrottleConfiguration()
Creates a default spam throttle configuration.
Definition: TransactionSpamThrottle.h:30
catapult::sync::CreateTransactionSpamThrottle
chain::UtUpdater::Throttle CreateTransactionSpamThrottle(const SpamThrottleConfiguration &config, const predicate< const model::Transaction & > &isBonded)
Definition: TransactionSpamThrottle.cpp:89
catapult::sync::SpamThrottleConfiguration::SpamThrottleConfiguration
SpamThrottleConfiguration(Amount maxBoostFee, Importance totalImportance, uint32_t maxCacheSize, uint32_t maxBlockSize)
Creates a spam throttle configuration around maxBoostFee, totalImportance, maxCacheSize and maxBlockS...
Definition: TransactionSpamThrottle.h:37
m_config
SpamThrottleConfiguration m_config
Definition: TransactionSpamThrottle.cpp:84
MemoryUtCache.h
catapult::sync::SpamThrottleConfiguration
Spam throttle configuration.
Definition: TransactionSpamThrottle.h:27
AccountStateCache.h
TransactionSpamThrottle.h
ReadOnlyCatapultCache.h
catapult::chain::UtUpdater::TransactionSource
TransactionSource
Sources of transactions that can be updated.
Definition: UtUpdater.h:42
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::sync::SpamThrottleConfiguration::TotalImportance
Importance TotalImportance
Total importance of all accounts.
Definition: TransactionSpamThrottle.h:49
ImportanceView.h