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::consensus::yac {
30  PeersNumberType all,
31  unsigned int k) {
32  if (number > all) {
33  return false;
34  }
35  return number * k >= (k - 1) * (all - 1) + k;
36  }
37 
49  PeersNumberType all,
50  unsigned int k) {
51  if (number > all) {
52  return false;
53  }
54  return number * k > all - 1;
55  }
56 } // namespace iroha::consensus::yac
57 
58 #endif // IROHA_SUPERMAJORITY_CHECKER_KF1_HPP
size_t PeersNumberType
Type for number of peers in round.
Definition: yac_types.hpp:13
bool checkKfPlus1Tolerance(PeersNumberType number, PeersNumberType all, unsigned int k)
Definition: supermajority_checker_kf1.hpp:48
bool checkKfPlus1Supermajority(PeersNumberType number, PeersNumberType all, unsigned int k)
Definition: supermajority_checker_kf1.hpp:29
Definition: cluster_order.hpp:16