When creating a new block, the blockreward being used was the block reward at the current chain height, not the block reward for the height that the chain would be once this new block is added. This inadvertently minted one extra block at the previous halving level.
This was not caught in consensus, because it also was calculating the block reward off the previous block, not the current block that it validates. So two wrongs didn't make it right, but made it functional.
Lastly, because the payee checks during consensus only check to make sure the block creator isn't trying to short change the masternodes, that code didn't care that the block creator was giving twice as much to the masternode then it should have... on those crossover blocks.
This corrects both sides, having the block creation look ahead in the rewards table for the reward relevant to the block being created, not the previous block created. Likewise the consensus looks up the current height of the block being validated, rather than the previous height.
When creating a new block, the blockreward being used was the block reward at the current chain height, not the block reward for the height that the chain would be once this new block is added. This inadvertently minted one extra block at the previous halving level.
This was not caught in consensus, because it also was calculating the block reward off the previous block, not the current block that it validates. So two wrongs didn't make it right, but made it functional.
Lastly, because the payee checks during consensus only check to make sure the block creator isn't trying to short change the masternodes, that code didn't care that the block creator was giving twice as much to the masternode then it should have... on those crossover blocks.
This corrects both sides, having the block creation look ahead in the rewards table for the reward relevant to the block being created, not the previous block created. Likewise the consensus looks up the current height of the block being validated, rather than the previous height.
This addresses PR #30