Skip to content

Commit

Permalink
Handle DevFee correctly when no MN payment
Browse files Browse the repository at this point in the history
  • Loading branch information
MattF42 authored Jan 13, 2024
1 parent 9eba4b6 commit d333ca3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/masternode-payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ void CMasternodePayments::FillBlockPayee(CMutableTransaction& txNew, int nBlockH
if(!mnodeman.GetNextMasternodeInQueueForPayment(nBlockHeight, true, nCount, mnInfo)) {
// ...and we can't calculate it on our own
LogPrintf("CMasternodePayments::FillBlockPayee Height: %d -- Failed to detect masternode to pay\n",nBlockHeight);
// We need to take the MN share of the DevFee off the mining reward here, otherwise the payment budget will be exceeded
int nMainNet = 1;
if(Params().NetworkIDString() == CBaseChainParams::REGTEST) {
nMainNet = 0;
};
CAmount foundationPayment = GetFoundationPayment(nBlockHeight,nMainNet);
txNew.vout[0].nValue -= foundationPayment/2;
//
return;
}
// fill payee with locally calculated winner and hope for the best
Expand Down

0 comments on commit d333ca3

Please sign in to comment.