fix: error in log if no masternode's registered yet "ERROR! Failed to 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)
This commit is contained in:
Konstantin Akimov 2024-10-29 16:08:23 +07:00
parent 80c5481c3e
commit 678db6f43e
No known key found for this signature in database
GPG Key ID: 2176C4A5D01EA524

View File

@ -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;
}
@ -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;
}