Bitcoin ABC  0.26.3
P2P Digital Currency
minerfund.cpp
Go to the documentation of this file.
1 // Copyright (c) 2023 The Bitcoin developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
6 
7 #include <blockindex.h>
8 #include <consensus/activation.h>
9 #include <minerfund.h>
10 
12  if (!m_blockIndex.pprev ||
14  // Do not apply the miner fund policy before Wellington activates.
15  return true;
16  }
17 
18  assert(m_block.vtx.size());
22  "policy-bad-miner-fund",
23  strprintf("Block %s violates miner fund policy",
25  }
26  return true;
27 }
bool IsWellingtonEnabled(const Consensus::Params &params, int32_t nHeight)
Check if May 15th, 2023 protocol upgrade has activated.
Definition: activation.cpp:91
std::vector< CTransactionRef > vtx
Definition: block.h:63
CBlockIndex * pprev
pointer to the index of the predecessor of this block
Definition: blockindex.h:33
BlockHash GetBlockHash() const
Definition: blockindex.h:147
const CBlock & m_block
Definition: minerfund.h:20
const Amount & m_blockReward
Definition: minerfund.h:21
const Consensus::Params & m_consensusParams
Definition: minerfund.h:22
bool operator()(BlockPolicyValidationState &state) override
Definition: minerfund.cpp:11
const CBlockIndex & m_blockIndex
Definition: minerfund.h:23
bool Invalid(Result result, const std::string &reject_reason="", const std::string &debug_message="")
Definition: validation.h:94
std::string ToString() const
Definition: uint256.h:80
bool CheckMinerFund(const Consensus::Params &params, const std::vector< CTxOut > &coinbaseTxOut, const Amount &blockReward, const CBlockIndex *pprev)
Returns false if there is an invalid miner fund.
Definition: minerfund.cpp:57
@ POLICY_VIOLATION
A block policy rule was violated. This block should be parked.
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition: tinyformat.h:1202
assert(!tx.IsCoinBase())