Skip to content
Prev Previous commit
Next Next commit
fix: use g_chainman.m_blockman.LookupBlockIndex for any known block (…
…even wrong tip)
  • Loading branch information
knst committed Oct 26, 2023
commit ca61600719638ae4ea55ff8f2327bfca658e65ca
4 changes: 2 additions & 2 deletions src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,9 @@ CDeterministicMNCPtr CDeterministicMNList::GetMNPayee(const CBlockIndex* pIndex)

std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayeesAtChainTip(int nCount) const
{
const CBlockIndex* const pindex = ::ChainActive()[nHeight];
const CBlockIndex* const pindex = WITH_LOCK(::cs_main, return g_chainman.m_blockman.LookupBlockIndex(blockHash));
if (pindex == nullptr) {
LogPrintf("GetProjectedMNPayeesAtChainTip WARNING pindex is nullptr due to height=%lld chain height=%lld\n", nHeight, ::ChainActive().Tip()->nHeight);
LogPrintf("GetProjectedMNPayeesAtChainTip WARNING pindex is nullptr on height=%lld blockhash=%s tip height=%lld tip hash=%s\n", nHeight, blockHash.ToString(), ::ChainActive().Tip()->nHeight, ::ChainActive().Tip()->GetBlockHash().ToString());
return {};
}
return GetProjectedMNPayees(pindex, nCount);
Expand Down