hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::consensus::yac::SupermajorityCheckerImpl Class Reference

#include "supermajority_checker_impl.hpp"

Inheritance diagram for iroha::consensus::yac::SupermajorityCheckerImpl:
Inheritance graph
Collaboration diagram for iroha::consensus::yac::SupermajorityCheckerImpl:
Collaboration graph

Public Member Functions

virtual ~SupermajorityCheckerImpl ()=default
 
virtual bool hasSupermajority (const shared_model::interface::types::SignatureRangeType &signatures, const std::vector< std::shared_ptr< shared_model::interface::Peer >> &peers) const override
 
virtual bool checkSize (PeersNumberType current, PeersNumberType all) const override
 
virtual bool peersSubset (const shared_model::interface::types::SignatureRangeType &signatures, const std::vector< std::shared_ptr< shared_model::interface::Peer >> &peers) const override
 
virtual bool hasReject (PeersNumberType frequent, PeersNumberType voted, PeersNumberType all) const override
 
- Public Member Functions inherited from iroha::consensus::yac::SupermajorityChecker
virtual ~SupermajorityChecker ()=default
 

Constructor & Destructor Documentation

virtual iroha::consensus::yac::SupermajorityCheckerImpl::~SupermajorityCheckerImpl ( )
virtualdefault

Member Function Documentation

bool iroha::consensus::yac::SupermajorityCheckerImpl::checkSize ( PeersNumberType  current,
PeersNumberType  all 
) const
overridevirtual

Check if supermajority is possible

Parameters
currentactual number of signatures
allnumber of peers
Returns
true if supermajority is possible or false otherwise

Implements iroha::consensus::yac::SupermajorityChecker.

Here is the caller graph for this function:

bool iroha::consensus::yac::SupermajorityCheckerImpl::hasReject ( PeersNumberType  frequent,
PeersNumberType  voted,
PeersNumberType  all 
) const
overridevirtual

Check if there is available reject proof. Reject proof is proof that in current round no one hash doesn't achieve supermajority.

Parameters
frequent- number of times, that appears most frequent element
voted- all number of voted peers
all- number of peers in round
Returns
true, if reject

Implements iroha::consensus::yac::SupermajorityChecker.

Here is the call graph for this function:

bool iroha::consensus::yac::SupermajorityCheckerImpl::hasSupermajority ( const shared_model::interface::types::SignatureRangeType signatures,
const std::vector< std::shared_ptr< shared_model::interface::Peer >> &  peers 
) const
overridevirtual

Checks if size of sets allows to have supermajority, then checks subset of signatures

Parameters
signaturesset of votes
peersset of all peers
Returns
true on supermajority is achieved or false otherwise

Implements iroha::consensus::yac::SupermajorityChecker.

Here is the call graph for this function:

bool iroha::consensus::yac::SupermajorityCheckerImpl::peersSubset ( const shared_model::interface::types::SignatureRangeType signatures,
const std::vector< std::shared_ptr< shared_model::interface::Peer >> &  peers 
) const
overridevirtual

Checks if signatures is a subset of signatures of peers

Parameters
signaturesto check
peerswith signatures
Returns
true if is subset or false otherwise

Implements iroha::consensus::yac::SupermajorityChecker.

Here is the call graph for this function:

Here is the caller graph for this function:


The documentation for this class was generated from the following files: