Skip to content

Commit

Permalink
fix: use g_chainman.m_blockman.LookupBlockIndex for any known block (…
Browse files Browse the repository at this point in the history
…even wrong tip)
  • Loading branch information
knst committed Sep 28, 2023
1 parent 7e295f8 commit 04fc666
Showing 1 changed file with 2 additions and 2 deletions.
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

0 comments on commit 04fc666

Please sign in to comment.