Current implementation of superblock fail-safe will always fail
Function CBudgetManager::FillBlockPayee() first finds highest proposal vote count (nHighestCount) and if the count is bigger then zero it pays to proposal otherwise it pays to dev fund.
if(nHighestCount > 0){ ... } else { // Pay dev fund }
But after payment in main.cpp it checks if it was correct payment
if(!IsBlockPayeeValid(block.vtx[0], nHeight)) { mapRejectedBlocks.insert(make_pair(block.GetHash(), GetTime())); return state.DoS(100, error("CheckBlock() : Couldn't find masternode/budget payment")); }
IsBlockPayeeValid calls budget.IsTransactionValid(txNew, nBlockHeight) where the same nHighestCount is calculated and the following condition is checked
if(nHighestCount < mnodeman.CountEnabled(MIN_BUDGET_PEER_PROTO_VERSION)/20) { return false; } else if (IsDevTransactionValid(txNew, nBlockHeight)) { return true; }
But because nHighestCount was zero this condition will never return true.
Why payment to dev fund worked successfully in testnet
In testnet we didn't have any proposal so nHighestCount was equal to 0 and miner paid to dev fund. After that it checked if transaction was valid.
if(nHighestCount < mnodeman.CountEnabled(MIN_BUDGET_PEER_PROTO_VERSION)/20) { ... }
Here if the count of total masternodes is less then 20 then the second part of the condition will equal to zero 18/20 = 0
And because (0 < 0) is false the above condition will return true.
We would see the issue in testnet if the condition was less or equal, so I would suggest to change the condition
if(nHighestCount <= mnodeman.CountEnabled(MIN_BUDGET_PEER_PROTO_VERSION)/20) {