#include <block_stats.hpp>
|
| BlockStats ()=default |
|
| BlockStats (const PeriodData &block, const std::vector< gas_t > &trxs_gas_used, uint64_t dpos_vote_count, uint32_t committee_size, const bool aspen_dag_rewards=false) |
| setting block_author_, max_votes_weight_ and calls processStats function More...
|
|
◆ taraxa::rewards::BlockStats::ValidatorStats
struct taraxa::rewards::BlockStats::ValidatorStats |
Class Members |
uint32_t |
dag_blocks_count_ |
|
u256 |
fees_rewards_ |
|
uint64_t |
vote_weight_ |
|
◆ BlockStats() [1/2]
taraxa::rewards::BlockStats::BlockStats |
( |
| ) |
|
|
default |
◆ BlockStats() [2/2]
taraxa::rewards::BlockStats::BlockStats |
( |
const PeriodData & |
block, |
|
|
const std::vector< gas_t > & |
trxs_gas_used, |
|
|
uint64_t |
dpos_vote_count, |
|
|
uint32_t |
committee_size, |
|
|
const bool |
aspen_dag_rewards = false |
|
) |
| |
setting block_author_, max_votes_weight_ and calls processStats function
- Parameters
-
dpos_vote_count | - votes count for previous block |
committee_size | |
aspen_dag_rewards | - aspen dag rewards |
◆ addTransaction()
bool taraxa::rewards::BlockStats::addTransaction |
( |
const trx_hash_t & |
trx_hash, |
|
|
const addr_t & |
validator |
|
) |
| |
|
private |
In case unique trx_hash is provided, it is mapped to it's validator's address + validator's unique trxs count is incremented. If provided trx_hash was already processed, nothing happens.
- Parameters
-
- Returns
- true in case trx_hash was unique and processed, otherwise false
◆ addVote()
bool taraxa::rewards::BlockStats::addVote |
( |
const std::shared_ptr< PbftVote > & |
vote | ) |
|
|
private |
In case unique vote is provided, author's votes weight is updated. If provided vote was already processed, nothing happens.
- Parameters
-
- Returns
- true in case vote was unique and processed, otherwise false
◆ initFeeByTrxHash()
void taraxa::rewards::BlockStats::initFeeByTrxHash |
( |
const SharedTransactions & |
transactions, |
|
|
const std::vector< gas_t > & |
trxs_gas_used |
|
) |
| |
|
private |
Prepare fee_by_trx_hash_ map with trx fee by trx hash.
- Parameters
-
transactions | collection with transactions included in the block |
trxs_gas_used | collection with gas used by transactions |
◆ processDagBlocks()
void taraxa::rewards::BlockStats::processDagBlocks |
( |
const PeriodData & |
block | ) |
|
|
private |
Process Dag blocks and save stats in class for future serialization. returns.
- Parameters
-
◆ processDagBlocksAspen()
void taraxa::rewards::BlockStats::processDagBlocksAspen |
( |
const PeriodData & |
block | ) |
|
|
private |
Process Dag blocks and save stats in class for future serialization with aspen HF changes. returns.
- Parameters
-
◆ processStats()
void taraxa::rewards::BlockStats::processStats |
( |
const PeriodData & |
block, |
|
|
const bool |
aspen_dag_rewards |
|
) |
| |
|
private |
Process PeriodData and save stats in class for future serialization. returns.
- Parameters
-
◆ block_author_
addr_t taraxa::rewards::BlockStats::block_author_ |
|
protected |
◆ fee_by_trx_hash_
std::unordered_map<trx_hash_t, u256> taraxa::rewards::BlockStats::fee_by_trx_hash_ |
|
protected |
◆ max_votes_weight_
uint64_t taraxa::rewards::BlockStats::max_votes_weight_ {0} |
|
protected |
◆ total_dag_blocks_count_
uint32_t taraxa::rewards::BlockStats::total_dag_blocks_count_ {0} |
|
protected |
◆ total_votes_weight_
uint64_t taraxa::rewards::BlockStats::total_votes_weight_ {0} |
|
protected |
◆ validators_stats_
The documentation for this class was generated from the following files: