23 const Amount &coinbaseValue,
28 return minerFundRatio * coinbaseValue / 100;
33 const auto mainNetParams =
39 static const std::string ecashMinerFund =
40 "ecash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvqd0y8lz07";
41 static const std::string bitcoinCashMinerFund =
42 "bitcoincash:prfhcnyqnl5cgrnmlfmms675w93ld7mvvq5zsvycff";
45 : bitcoinCashMinerFund);
50std::unordered_set<CTxDestination, TxDestinationHasher>
60 const std::vector<CTxOut> &coinbaseTxOut,
63 if (whitelist.empty()) {
68 for (
auto &o : coinbaseTxOut) {
69 if (o.nValue < required) {
80 if (std::find(whitelist.begin(), whitelist.end(), address) !=
bool IsCowperthwaiteEnabled(const Consensus::Params ¶ms, int32_t nHeight)
Check if Nov 15th, 2023 protocol upgrade has activated.
std::unique_ptr< const CChainParams > CreateChainParams(const ArgsManager &args, const std::string &chain)
Creates and returns a std::unique_ptr<CChainParams> of the chosen chain.
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
static const std::string MAIN
BIP70 chain name strings (main, test or regtest)
The block chain is a tree shaped structure starting with the genesis block at the root,...
constexpr bool DEFAULT_ECASH
CTxDestination DecodeDestination(const std::string &addr, const CChainParams ¶ms)
static CTxDestination BuildDestination(const std::string &dest)
static constexpr int MINER_FUND_RATIO
static const CTxDestination & GetMinerFundDestination()
static constexpr int LEGACY_MINER_FUND_RATIO
Percentage of the block reward to be sent to the fund.
bool CheckMinerFund(const Consensus::Params ¶ms, const std::vector< CTxOut > &coinbaseTxOut, const Amount &blockReward, const CBlockIndex *pprev)
Returns false if there is an invalid miner fund.
std::unordered_set< CTxDestination, TxDestinationHasher > GetMinerFundWhitelist(const Consensus::Params ¶ms)
Amount GetMinerFundAmount(const Consensus::Params ¶ms, const Amount &coinbaseValue, const CBlockIndex *pprev)
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a standard scriptPubKey for the destination address.
std::variant< CNoDestination, PKHash, ScriptHash > CTxDestination
A txout script template with a specific destination.
Parameters that influence chain consensus.
bool enableMinerFund
Enable or disable the miner fund by default.