Skip to content

Commit

Permalink
fix: error in log if no masternode's registered yet "ERROR! Failed to…
Browse files Browse the repository at this point in the history
… get payees for block at height"

    [httpworker.0] [masternode/payments.cpp:116] [IsTransactionValid] CMNPaymentsProcessor::IsTransactionValid -- ERROR! Failed to get payees for block at height 110
    [httpworker.0] [masternode/payments.cpp:278] [IsBlockPayeeValid] CMNPaymentsProcessor::IsBlockPayeeValid -- Valid masternode payment at height 110: CTransaction(hash=837e35fab5, ver=3, type=5, vin.size=1, vout.size=1, nLockTime=0, vExtraPayload.size=70)
                                           CTxIn(COutPoint(0000000000000000000000000000000000000000000000000000000000000000, 4294967295), coinbase 016e0101)
                                           CTxOut(nValue=500.00000000, scriptPubKey=76a9148708dff2bf8b31363cb4201d)
  • Loading branch information
knst committed Oct 29, 2024
1 parent 1bef564 commit 75db349
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/masternode/payments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,12 @@ CAmount PlatformShare(const CAmount reward)
LogPrint(BCLog::MNPAYMENTS, "CMNPaymentsProcessor::%s -- MN reward %lld reallocated to credit pool\n", __func__, platformReward);
voutMasternodePaymentsRet.emplace_back(platformReward, CScript() << OP_RETURN);
}

auto dmnPayee = m_dmnman.GetListForBlock(pindexPrev).GetMNPayee(pindexPrev);
const auto mnList = m_dmnman.GetListForBlock(pindexPrev);
if (mnList.GetAllMNsCount() == 0) {
LogPrint(BCLog::MNPAYMENTS, "CMNPaymentsProcessor::%s -- no masternode registered to receive a payment\n", __func__);
return true;
}
const auto dmnPayee = mnList.GetMNPayee(pindexPrev);
if (!dmnPayee) {
return false;
}
Expand Down Expand Up @@ -88,7 +92,7 @@ CAmount PlatformShare(const CAmount reward)
voutMasternodePaymentsRet.clear();

if(!GetBlockTxOuts(pindexPrev, blockSubsidy, feeReward, voutMasternodePaymentsRet)) {
LogPrintf("CMNPaymentsProcessor::%s -- No payee (deterministic masternode list empty)\n", __func__);
LogPrintf("CMNPaymentsProcessor::%s -- ERROR Failed to get payee\n", __func__);
return false;
}

Expand Down

0 comments on commit 75db349

Please sign in to comment.