class that is managing rewards stats processing and hardforks(intervals changes) So intermediate blocks stats are stored in the vector in data(to restore on the node restart) and full list of interval stats is returned in the end of interval
More...
#include <rewards_stats.hpp>
class that is managing rewards stats processing and hardforks(intervals changes) So intermediate blocks stats are stored in the vector in data(to restore on the node restart) and full list of interval stats is returned in the end of interval
◆ Stats()
◆ clear()
void taraxa::rewards::Stats::clear |
( |
uint64_t |
current_period | ) |
|
called on start of new rewards interval. clears blocks_stats_ collection and removes all data saved in db column
◆ getBlockStats()
◆ getCurrentDistributionFrequency()
uint32_t taraxa::rewards::Stats::getCurrentDistributionFrequency |
( |
uint64_t |
current_period | ) |
const |
|
protected |
returns rewards distribution frequency for specified period
◆ processStats()
std::vector< BlockStats > taraxa::rewards::Stats::processStats |
( |
const PeriodData & |
current_blk, |
|
|
const std::vector< gas_t > & |
trxs_gas_used, |
|
|
Batch & |
write_batch |
|
) |
| |
processing passed block and returns stats that should be processed at this block
- Parameters
-
current_blk | block to process |
- Returns
- vector<BlockStats> that should be processed at current block
◆ recoverFromDb()
void taraxa::rewards::Stats::recoverFromDb |
( |
EthBlockNumber |
last_blk_num | ) |
|
|
protected |
recover current interval stats from database
◆ saveBlockStats()
void taraxa::rewards::Stats::saveBlockStats |
( |
uint64_t |
number, |
|
|
const BlockStats & |
stats, |
|
|
Batch & |
write_batch |
|
) |
| |
|
protected |
saves stats to database to not lose this data in case of node restart
◆ blocks_stats_
◆ db_
std::shared_ptr<DbStorage> taraxa::rewards::Stats::db_ |
|
protected |
◆ dpos_eligible_total_vote_count_
const std::function<uint64_t(EthBlockNumber)> taraxa::rewards::Stats::dpos_eligible_total_vote_count_ |
|
protected |
◆ kCommitteeSize
const uint32_t taraxa::rewards::Stats::kCommitteeSize |
|
protected |
◆ kHardforksConfig
The documentation for this class was generated from the following files: