Skip to content

Commit

Permalink
use proper head in masternode's payment IsMNRewardRealloced
Browse files Browse the repository at this point in the history
  • Loading branch information
knst committed Jul 12, 2023
1 parent 7c24707 commit 2d85946
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/masternode/payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ static bool GetBlockTxOuts(const int nBlockHeight, const CAmount blockReward, st

CAmount masternodeReward = GetMasternodePayment(nBlockHeight, blockReward, Params().GetConsensus().BRRHeight);

bool fMNRewardReallocated = llmq::utils::IsMNRewardReallocationActive(::ChainActive().Tip());
const CBlockIndex* pindex = WITH_LOCK(cs_main, return ::ChainActive()[nBlockHeight - 1]);
bool fMNRewardReallocated = llmq::utils::IsMNRewardReallocationActive(pindex);

if (fMNRewardReallocated) {
LogPrintf("CMasternodePayments::%s -- MN reward %lld reallocated to credit pool\n", __func__, masternodeReward);
voutMasternodePaymentsRet.emplace_back(masternodeReward, CScript() << OP_RETURN);
return true;
}

const CBlockIndex* pindex = WITH_LOCK(cs_main, return ::ChainActive()[nBlockHeight - 1]);
auto dmnPayee = deterministicMNManager->GetListForBlock(pindex).GetMNPayee(pindex);
if (!dmnPayee) {
return false;
Expand Down

0 comments on commit 2d85946

Please sign in to comment.