Skip to content

Commit

Permalink
removed special testnet conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
ogabrielides committed Oct 18, 2023
1 parent 63ed462 commit bb5288f
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/llmq/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,6 @@ bool IsMNRewardReallocationActive(const CBlockIndex* pindex)
{
assert(pindex);
if (!IsV20Active(pindex)) return false;
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) return IsV20Active(pindex); // TODO remove this before re-hardforking testnet to check EHF

LOCK(cs_llmq_vbc);
return VersionBitsState(pindex, Params().GetConsensus(), Consensus::DEPLOYMENT_MN_RR, llmq_versionbitscache) == ThresholdState::ACTIVE;
Expand Down
4 changes: 0 additions & 4 deletions src/masternode/payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
CAmount masternodeReward = GetMasternodePayment(nBlockHeight, blockSubsidy + feeReward, fMNRewardReallocated);
if (fMNRewardReallocated) {
CAmount masternodeSubsidyReward = GetMasternodePayment(nBlockHeight, blockSubsidy, fMNRewardReallocated);
// TODO remove this when we re-organize testnet
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) {
masternodeSubsidyReward = masternodeReward;
}
const CAmount platformReward = MasternodePayments::PlatformShare(masternodeSubsidyReward);
masternodeReward -= platformReward;

Expand Down
10 changes: 2 additions & 8 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,7 @@ static std::pair<CAmount, CAmount> GetBlockSubsidyHelper(int nPrevBits, int nPre
dDiff = ConvertBitsToDouble(nPrevBits);
}

// TODO remove "not testnet" condition when we re-organize testnet
if (fV20Active && Params().NetworkIDString() != CBaseChainParams::TESTNET) {
if (fV20Active) {
// Starting from V20 Activation, subsidybase should be stable.
// Currently, nSubsidyBase calculate relies on difficulty.
// Once Platform is live, it must constantly get blocks difficulty in order to calculate platformReward.
Expand Down Expand Up @@ -1174,8 +1173,6 @@ static std::pair<CAmount, CAmount> GetBlockSubsidyHelper(int nPrevBits, int nPre
// Hard fork to reduce the block reward by 10 extra percent (allowing budget/superblocks)
if (nPrevHeight > consensusParams.nBudgetPaymentsStartBlock) {
// Once MNRewardReallocated is active, the treasury is 20% instead of 10%
// TODO remove this when we re-organize testnet
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) fMNRewardReallocated = false;
nSuperblockPart = nSubsidy / (fMNRewardReallocated ? 5 : 10);
}
return {nSubsidy - nSuperblockPart, nSuperblockPart};
Expand Down Expand Up @@ -1234,8 +1231,6 @@ CAmount GetMasternodePayment(int nHeight, CAmount blockValue, bool fMNRewardReal
return ret;
}

// TODO remove this when we re-organize testnet
if (Params().NetworkIDString() == CBaseChainParams::TESTNET) fMNRewardReallocated = false;
if (fMNRewardReallocated) {
// Once MNRewardReallocated activates, block reward is 80% of block subsidy (+ tx fees) since treasury is 20%
// Since the MN reward needs to be equal to 60% of the block subsidy (according to the proposal), MN reward is set to 75% of the block reward.
Expand Down Expand Up @@ -2404,8 +2399,7 @@ bool CChainState::ConnectBlock(const CBlock& block, BlockValidationState& state,
int64_t nTime5_2 = GetTimeMicros(); nTimeSubsidy += nTime5_2 - nTime5_1;
LogPrint(BCLog::BENCHMARK, " - GetBlockSubsidy: %.2fms [%.2fs (%.2fms/blk)]\n", MILLI * (nTime5_2 - nTime5_1), nTimeSubsidy * MICRO, nTimeSubsidy * MILLI / nBlocksTotal);

// TODO remove "if testnet" condition when we re-organize testnet
if (!CheckCreditPoolDiffForBlock(block, pindex, m_params.GetConsensus(), (m_params.NetworkIDString() == CBaseChainParams::TESTNET) ? (blockSubsidy + feeReward) : blockSubsidy, state)) {
if (!CheckCreditPoolDiffForBlock(block, pindex, m_params.GetConsensus(), blockSubsidy, state)) {
return error("ConnectBlock(DASH): CheckCreditPoolDiffForBlock for block %s failed with %s",
pindex->GetBlockHash().ToString(), state.ToString());
}
Expand Down

0 comments on commit bb5288f

Please sign in to comment.