hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
supermajority_checker_kf1.hpp
Go to the documentation of this file.
1 
6 #ifndef IROHA_SUPERMAJORITY_CHECKER_KF1_HPP
7 #define IROHA_SUPERMAJORITY_CHECKER_KF1_HPP
8 
10 
11 namespace iroha {
12  namespace consensus {
13  namespace yac {
14 
33  PeersNumberType all,
34  unsigned int k) {
35  if (number > all) {
36  return false;
37  }
38  return number * k >= (k - 1) * (all - 1) + k;
39  }
40 
52  PeersNumberType all,
53  unsigned int k) {
54  if (number > all) {
55  return false;
56  }
57  return number * k > all - 1;
58  }
59 
60  } // namespace yac
61  } // namespace consensus
62 } // namespace iroha
63 
64 #endif // IROHA_SUPERMAJORITY_CHECKER_KF1_HPP
Definition: block_query.hpp:15
size_t PeersNumberType
Type for number of peers in round.
Definition: yac_types.hpp:16
bool checkKfPlus1Tolerance(PeersNumberType number, PeersNumberType all, unsigned int k)
Definition: supermajority_checker_kf1.hpp:51
bool checkKfPlus1Supermajority(PeersNumberType number, PeersNumberType all, unsigned int k)
Definition: supermajority_checker_kf1.hpp:32