FillBlockPayee() uses the height of the last block to get the blockValue; which will be one behind what it should be. Doesn't make a difference, except on halving events; where it will pay the higher amount even though it shouldn't.
This is exacerbated by the fact that consensus also has the same problem; and validates that it matches the expected for the previous block, not the current block:
It cleared IsTransactionValid because the drift doesn't care if you overpay the masternode.
e.g. GetBlockValue(previous) = 30
GetBlockValue(current) = 15
At a 30% seesaw; Masternode Payment minimum is 8.85 (15.59); and the masternode is being paid 17.7 (30.59).
So consensus passes the blockValue of 30, because it's also looking one block behind. Masternode Payment is acceptable because consensus only cares that the minter doesn't shortchange the masternode.
Describe the issue
FillBlockPayee() uses the height of the last block to get the blockValue; which will be one behind what it should be. Doesn't make a difference, except on halving events; where it will pay the higher amount even though it shouldn't.
This is exacerbated by the fact that consensus also has the same problem; and validates that it matches the expected for the previous block, not the current block:
CAmount nExpectedMint = GetBlockValue(pindex->pprev->nHeight);
It cleared IsTransactionValid because the drift doesn't care if you overpay the masternode.
e.g. GetBlockValue(previous) = 30 GetBlockValue(current) = 15
At a 30% seesaw; Masternode Payment minimum is 8.85 (15.59); and the masternode is being paid 17.7 (30.59).
So consensus passes the blockValue of 30, because it's also looking one block behind. Masternode Payment is acceptable because consensus only cares that the minter doesn't shortchange the masternode.