6#ifndef ALT_INTEGRATION_INCLUDE_VERIBLOCK_DEFAULT_POPREWARDS_CALCULATOR_HPP_
7#define ALT_INTEGRATION_INCLUDE_VERIBLOCK_DEFAULT_POPREWARDS_CALCULATOR_HPP_
9#include <veriblock/pop/blockchain/alt_block_tree.hpp>
10#include <veriblock/pop/entities/pop_payouts.hpp>
12#include "poprewards_bigdecimal.hpp"
13#include "poprewards_calculator.hpp"
71 PopRewardsBigDecimal scoreForThisBlock,
72 PopRewardsBigDecimal difficulty)
const;
83 uint32_t vbkRelativeHeight,
84 const PopRewardsBigDecimal& scoreForThisBlock,
85 const PopRewardsBigDecimal& blockReward)
const;
96 int relativeBlock)
const;
124 const PopRewardsBigDecimal& endorsedBlockScore,
125 const PopRewardsBigDecimal& popDifficulty,
Class that is used for storing validation state.
Represents simplified view on Altchain's block tree, maintains VBK tree and BTC tree.
PopRewardsBigDecimal calculateDifficulty(const BlockIndex< AltBlock > &tip)
Calculate POP difficulty using a list of blocks.
PopRewardsBigDecimal getScoreMultiplierFromRelativeBlock(int relativeBlock) const
Applies penalty for distant endorsements in VBK chain.
PopRewardsBigDecimal calculateMinerReward(uint32_t vbkRelativeHeight, const PopRewardsBigDecimal &scoreForThisBlock, const PopRewardsBigDecimal &blockReward) const
Calculate reward for the miner from the block score, height of the VBK endorsement and total block re...
bool calculatePayoutsInner(const BlockIndex< AltBlock > &endorsedBlock, const PopRewardsBigDecimal &endorsedBlockScore, const PopRewardsBigDecimal &popDifficulty, PopPayouts &rewards, ValidationState &state)
Calculate POP rewards for miners.
bool calculatePayouts(const BlockIndex< AltBlock > &endorsedBlock, PopPayouts &rewards, ValidationState &state)
Calculate POP rewards for miners.
PopRewardsBigDecimal scoreFromEndorsements(const BlockIndex< AltBlock > &endorsedBlock)
Collect all endorsements for the endorsed block and calculate POP score.
PopRewardsBigDecimal calculateBlockReward(uint32_t height, PopRewardsBigDecimal scoreForThisBlock, PopRewardsBigDecimal difficulty) const
Calculate reward for the entire block from the block score, height of the VBK endorsement and current...
uint32_t getRoundForBlockNumber(uint32_t height) const
Calculate payout round from the given block height.
bool getPopPayout(const AltBlockTree::hash_t &tip, PopPayouts &rewards, ValidationState &state) override
Calculate POP rewards for miners.
A container for Pop payouts information.