diff --git a/qa/rpc-tests/coinbase_funding_streams.py b/qa/rpc-tests/coinbase_funding_streams.py index b5c3bf7be..5778f932f 100755 --- a/qa/rpc-tests/coinbase_funding_streams.py +++ b/qa/rpc-tests/coinbase_funding_streams.py @@ -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 . diff --git a/src/consensus/params.h b/src/consensus/params.h index 1f43442d4..c39799d4a 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -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; diff --git a/src/main.h b/src/main.h index 8b61249f2..ef515f1eb 100644 --- a/src/main.h +++ b/src/main.h @@ -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); diff --git a/src/miner.cpp b/src/miner.cpp index 83648e2af..cee692a75 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -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. } }