#include <pillar_votes.hpp>
◆ taraxa::pillar_chain::PillarVotes::PeriodVotes
struct taraxa::pillar_chain::PillarVotes::PeriodVotes |
◆ taraxa::pillar_chain::PillarVotes::WeightVotes
struct taraxa::pillar_chain::PillarVotes::WeightVotes |
Class Members |
unordered_map< vote_hash_t, pair< shared_ptr< PillarVote >, uint64_t > > |
votes |
|
uint64_t |
weight |
|
◆ addVerifiedVote()
bool taraxa::pillar_chain::PillarVotes::addVerifiedVote |
( |
const std::shared_ptr< PillarVote > & |
vote, |
|
|
uint64_t |
validator_vote_count |
|
) |
| |
Add a vote to the votes map.
- Parameters
-
vote | vote |
validator_vote_count | |
- Returns
- true if vote was successfully added, otherwise false
◆ eraseVotes()
void taraxa::pillar_chain::PillarVotes::eraseVotes |
( |
PbftPeriod |
min_period | ) |
|
Erases votes wit period < min_period.
- Parameters
-
◆ getVerifiedVotes()
std::vector< std::shared_ptr< PillarVote > > taraxa::pillar_chain::PillarVotes::getVerifiedVotes |
( |
PbftPeriod |
period, |
|
|
const blk_hash_t & |
pillar_block_hash, |
|
|
bool |
above_threshold = false |
|
) |
| const |
Get all pillar block votes for specified pillar block.
- Parameters
-
period | |
pillar_block_hash | |
above_threshold | if true, return only if there is > threshold verified votes |
- Returns
- all pillar block votes for specified period and pillar block hash. In case above_threshold == true, votes are sorted based on vote weight and the minimum number of votes above threshold are returned
◆ initializePeriodData()
void taraxa::pillar_chain::PillarVotes::initializePeriodData |
( |
PbftPeriod |
period, |
|
|
uint64_t |
threshold |
|
) |
| |
Initialize period data with period_two_t_plus_one.
- Parameters
-
◆ isUniqueVote()
bool taraxa::pillar_chain::PillarVotes::isUniqueVote |
( |
const std::shared_ptr< PillarVote > |
vote | ) |
const |
Checks if vote is unique per period & validator.
- Parameters
-
- Returns
- true if unique, otherwise false
◆ periodDataInitialized()
bool taraxa::pillar_chain::PillarVotes::periodDataInitialized |
( |
PbftPeriod |
period | ) |
const |
Checks if specified period data have been already initialized.
- Parameters
-
- Returns
- true if initialized, othwrwise false
◆ voteExists()
bool taraxa::pillar_chain::PillarVotes::voteExists |
( |
const std::shared_ptr< PillarVote > |
vote | ) |
const |
Checks if vote exists.
- Parameters
-
- Returns
- true if exists, otherwise false
◆ mutex_
std::shared_mutex taraxa::pillar_chain::PillarVotes::mutex_ |
|
mutableprivate |
◆ votes_
The documentation for this class was generated from the following files: