Kagome
Polkadot Runtime Engine in C++17
pool_moderator.hpp
Go to the documentation of this file.
1 
6 #ifndef KAGOME_POOL_MODERATOR_HPP
7 #define KAGOME_POOL_MODERATOR_HPP
8 
11 
12 namespace kagome::transaction_pool {
13 
14  using primitives::Transaction;
15 
21  class PoolModerator {
22  public:
23  virtual ~PoolModerator() = default;
24 
29  virtual void ban(const common::Hash256 &tx_hash) = 0;
30 
36  virtual bool banIfStale(primitives::BlockNumber current_block,
37  const Transaction &tx) = 0;
38 
42  virtual bool isBanned(const Transaction::Hash &tx_hash) const = 0;
43 
47  virtual void updateBan() = 0;
48 
52  virtual size_t bannedNum() const = 0;
53  };
54 
55 } // namespace kagome::transaction_pool
56 
57 #endif // KAGOME_POOL_MODERATOR_HPP
common::Hash256 Hash
virtual bool banIfStale(primitives::BlockNumber current_block, const Transaction &tx)=0
virtual void ban(const common::Hash256 &tx_hash)=0
virtual bool isBanned(const Transaction::Hash &tx_hash) const =0
virtual size_t bannedNum() const =0
uint32_t BlockNumber
Definition: common.hpp:18