Minor fixes for ZIP-207 review comments.
This commit is contained in:
parent
074d054e84
commit
92cec200ee
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/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
|
# Distributed under the MIT software license, see the accompanying
|
||||||
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
# file COPYING or https://www.opensource.org/licenses/mit-license.php .
|
||||||
|
|
||||||
|
|
|
@ -200,10 +200,6 @@ struct Params {
|
||||||
|
|
||||||
int FundingPeriodIndex(int fundingStreamStartHeight, int nHeight) const;
|
int FundingPeriodIndex(int fundingStreamStartHeight, int nHeight) const;
|
||||||
|
|
||||||
bool FundingStreamsActive(int nHeight) const {
|
|
||||||
return nHeight > GetLastFoundersRewardBlockHeight(nHeight);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Used to check majorities for block version upgrade */
|
/** Used to check majorities for block version upgrade */
|
||||||
int nMajorityEnforceBlockUpgrade;
|
int nMajorityEnforceBlockUpgrade;
|
||||||
int nMajorityRejectBlockOutdated;
|
int nMajorityRejectBlockOutdated;
|
||||||
|
|
|
@ -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
|
* Check a block is completely valid from start to finish (only works on top
|
||||||
* of our current best block, with cs_main held)
|
* 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);
|
bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams, const CBlock& block, CBlockIndex* pindexPrev, bool fCheckPOW = true, bool fCheckMerkleRoot = true);
|
||||||
|
|
||||||
|
|
|
@ -184,15 +184,16 @@ public:
|
||||||
throw new std::runtime_error("Failed to add funding stream output.");
|
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 {
|
} else {
|
||||||
if (nHeight <= chainparams.GetConsensus().GetLastFoundersRewardBlockHeight(nHeight)) {
|
// Founders reward ends without replacement if Canopy is not activated by the
|
||||||
// Founders reward is 20% of the block subsidy
|
// last Founders' Reward block height + 1.
|
||||||
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)));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue