hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
kick_out_proposal_creation_strategy.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_KICK_OUT_PROPOSAL_CREATION_STRATEGY_HPP
7 #define IROHA_KICK_OUT_PROPOSAL_CREATION_STRATEGY_HPP
8 
10 
11 #include <map>
12 #include <memory>
13 #include <mutex>
14 
16 
17 namespace iroha {
18  namespace ordering {
19 
24  public:
28  std::shared_ptr<SupermajorityCheckerType> tolerance_checker);
29 
31  size_t peers_in_round) override;
32 
33  bool shouldCreateRound(RoundType round) override;
34 
35  boost::optional<RoundType> onProposalRequest(
36  RoundType requested_round) override;
37 
38  private:
39  using RoundCollectionType = std::map<RoundType, size_t>;
40 
41  std::mutex mutex_;
42  std::shared_ptr<SupermajorityCheckerType> tolerance_checker_;
43  size_t peers_in_round_;
44  RoundCollectionType requested_count_;
45  };
46  } // namespace ordering
47 } // namespace iroha
48 
49 #endif // IROHA_KICK_OUT_PROPOSAL_CREATION_STRATEGY_HPP
bool shouldCreateRound(RoundType round) override
Definition: kick_out_proposal_creation_strategy.cpp:26
Definition: kick_out_proposal_creation_strategy.hpp:23
boost::optional< RoundType > onProposalRequest(RoundType requested_round) override
Definition: kick_out_proposal_creation_strategy.cpp:33
Definition: block_query.hpp:14
Definition: ordering_service_proposal_creation_strategy.hpp:19
Definition: round.hpp:31
KickOutProposalCreationStrategy(std::shared_ptr< SupermajorityCheckerType > tolerance_checker)
Definition: kick_out_proposal_creation_strategy.cpp:12
void onCollaborationOutcome(RoundType round, size_t peers_in_round) override
Definition: kick_out_proposal_creation_strategy.cpp:16
Definition: supermajority_checker.hpp:31