From 7dde4835e9552b2f94f94155dfa0d77d0808aa5c Mon Sep 17 00:00:00 2001 From: Block Mechanic Date: Thu, 6 Oct 2022 13:04:00 +0200 Subject: [PATCH] Update miner.cpp --- src/miner.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/miner.cpp b/src/miner.cpp index 6bc2cbe..b217016 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -229,7 +229,14 @@ std::unique_ptr BlockAssembler::CreateNewBlock(const CScript& sc nValueNodeRewards += coinbaseTx.vout[SN_PMT_SLOT].nValue; } - if ((Params().NetworkIDString() == CBaseChainParams::TESTNET && !budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1)) || (!(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1)))){ + if(Params().NetworkIDString() == CBaseChainParams::TESTNET && !budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1)){ + //Reduce PoS reward by the node rewards + if(txCoinStake.nVersion >= TX_ELE_VERSION) + txCoinStake.vpout[0].nValue = GetBlockValue(nHeight, nFees) - nValueNodeRewards; + else + txCoinStake.vout[0].nValue = GetBlockValue(nHeight, nFees) - nValueNodeRewards; + } + else if (!(IsSporkActive(SPORK_13_ENABLE_SUPERBLOCKS) && budget.IsBudgetPaymentBlock(pindexPrev->nHeight + 1))){ //Reduce PoS reward by the node rewards if(txCoinStake.nVersion >= TX_ELE_VERSION) txCoinStake.vpout[0].nValue = GetBlockValue(nHeight, nFees) - nValueNodeRewards;