Minor fixes for ZIP-207 review comments.

This commit is contained in:
Kris Nuttycombe 2020-06-29 16:13:08 -06:00
parent 074d054e84
commit 92cec200ee
4 changed files with 10 additions and 15 deletions

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python3
# Copyright (c) 2019 The Zcash developers
# Copyright (c) 2020 The Zcash developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://www.opensource.org/licenses/mit-license.php .

View File

@ -200,10 +200,6 @@ struct Params {
int FundingPeriodIndex(int fundingStreamStartHeight, int nHeight) const;
bool FundingStreamsActive(int nHeight) const {
return nHeight > GetLastFoundersRewardBlockHeight(nHeight);
}
/** Used to check majorities for block version upgrade */
int nMajorityEnforceBlockUpgrade;
int nMajorityRejectBlockOutdated;

View File

@ -468,8 +468,6 @@ bool ConnectBlock(const CBlock& block, CValidationState& state, CBlockIndex* pin
/**
* Check a block is completely valid from start to finish (only works on top
* of our current best block, with cs_main held)
*
* Returns an error if block validation fails, boost::none otherwise.
*/
bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);

View File

@ -184,15 +184,16 @@ public:
throw new std::runtime_error("Failed to add funding stream output.");
}
}
} else if (nHeight <= chainparams.GetConsensus().GetLastFoundersRewardBlockHeight(nHeight)) {
// Founders reward is 20% of the block subsidy
auto vFoundersReward = miner_reward / 5;
// Take some reward away from us
miner_reward -= vFoundersReward;
// And give it to the founders
mtx.vout.push_back(CTxOut(vFoundersReward, chainparams.GetFoundersRewardScriptAtHeight(nHeight)));
} else {
if (nHeight <= chainparams.GetConsensus().GetLastFoundersRewardBlockHeight(nHeight)) {
// Founders reward is 20% of the block subsidy
auto vFoundersReward = miner_reward / 5;
// Take some reward away from us
miner_reward -= vFoundersReward;
// And give it to the founders
mtx.vout.push_back(CTxOut(vFoundersReward, chainparams.GetFoundersRewardScriptAtHeight(nHeight)));
}
// Founders reward ends without replacement if Canopy is not activated by the
// last Founders' Reward block height + 1.
}
}