32 std::vector<CScript> winners;
37 "Staking rewards for block %s: not ready yet\n",
44 if (o.nValue < required) {
49 if (std::find(winners.begin(), winners.end(), o.scriptPubKey) !=
56 "Staking rewards for block %s: payout script mismatch!\n",
60 "policy-bad-staking-reward",
61 strprintf(
"Block %s violates staking reward policy",
bool IsCowperthwaiteEnabled(const Consensus::Params ¶ms, int32_t nHeight)
Check if Nov 15th, 2023 protocol upgrade has activated.
bool isAvalancheEnabled(const ArgsManager &argsman)
std::unique_ptr< avalanche::Processor > g_avalanche
Global avalanche instance.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
std::vector< CTransactionRef > vtx
The block chain is a tree shaped structure starting with the genesis block at the root,...
CBlockIndex * pprev
pointer to the index of the predecessor of this block
BlockHash GetBlockHash() const
bool operator()(BlockPolicyValidationState &state) override
const Consensus::Params & m_consensusParams
const Amount & m_blockReward
const CBlockIndex & m_blockIndex
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
std::string ToString() const
#define LogPrint(category,...)
@ POLICY_VIOLATION
A block policy rule was violated. This block should be parked.
bool IsStakingRewardsActivated(const Consensus::Params ¶ms, const CBlockIndex *pprev)
static constexpr int STAKING_REWARD_RATIO
Percentage of the block reward to be sent to staking rewards.
Amount GetStakingRewardsAmount(const Amount &coinbaseValue)
A BlockHash is a unqiue identifier for a block.
Parameters that influence chain consensus.
bool enableStakingRewards
Enable or disable the staking rewards by default.