CatapultServer
v0.5.0.1 (Elephant)
|
A read only view on top of unconfirmed transactions cache. More...
Public Member Functions | |
MemoryUtCacheView (uint64_t maxResponseSize, const TransactionDataContainer &transactionDataContainer, const IdLookup &idLookup, utils::SpinReaderWriterLock::ReaderLockGuard &&readLock) | |
size_t | size () const |
Returns the number of unconfirmed transactions in the cache. More... | |
bool | contains (const Hash256 &hash) const |
Returns true if the cache contains an unconfirmed transaction with associated hash, false otherwise. More... | |
void | forEach (const TransactionInfoConsumer &consumer) const |
Calls consumer with all transaction infos until all are consumed or false is returned by consumer. More... | |
model::ShortHashRange | shortHashes () const |
UnknownTransactions | unknownTransactions (BlockFeeMultiplier minFeeMultiplier, const utils::ShortHashesSet &knownShortHashes) const |
Private Types | |
using | UnknownTransactions = std::vector< std::shared_ptr< const model::Transaction > > |
using | IdLookup = std::unordered_map< Hash256, size_t, utils::ArrayHasher< Hash256 > > |
using | TransactionInfoConsumer = predicate< const model::TransactionInfo & > |
Private Attributes | |
uint64_t | m_maxResponseSize |
const TransactionDataContainer & | m_transactionDataContainer |
const IdLookup & | m_idLookup |
utils::SpinReaderWriterLock::ReaderLockGuard | m_readLock |
A read only view on top of unconfirmed transactions cache.
|
private |
|
private |
|
private |
|
explicit |
Creates a view around a maximum response size (maxResponseSize), a transaction data container (transactionDataContainer) and an id lookup (idLookup) with lock context readLock.
bool catapult::cache::MemoryUtCacheView::contains | ( | const Hash256 & | hash | ) | const |
Returns true
if the cache contains an unconfirmed transaction with associated hash, false
otherwise.
void catapult::cache::MemoryUtCacheView::forEach | ( | const TransactionInfoConsumer & | consumer | ) | const |
Calls consumer with all transaction infos until all are consumed or false
is returned by consumer.
model::ShortHashRange catapult::cache::MemoryUtCacheView::shortHashes | ( | ) | const |
Gets a range of short hashes of all transactions in the cache. A short hash consists of the first 4 bytes of the complete hash.
size_t catapult::cache::MemoryUtCacheView::size | ( | ) | const |
Returns the number of unconfirmed transactions in the cache.
MemoryUtCacheView::UnknownTransactions catapult::cache::MemoryUtCacheView::unknownTransactions | ( | BlockFeeMultiplier | minFeeMultiplier, |
const utils::ShortHashesSet & | knownShortHashes | ||
) | const |
Gets a vector of all transactions in the cache that have a fee multiplier at least minFeeMultiplier and do not have a short hash in knownShortHashes.
|
private |
|
private |
|
private |
|
private |