Skip to content

Commit

Permalink
fix: fix crashes introduced in 5493
Browse files Browse the repository at this point in the history
  • Loading branch information
UdjinM6 committed Aug 17, 2023
1 parent 24a4ed3 commit 9568921
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/evo/deterministicmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,10 @@ CDeterministicMNCPtr CDeterministicMNList::GetMNPayee(const CBlockIndex* pIndex)

std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayeesAtChainTip(int nCount) const
{
return GetProjectedMNPayees(::ChainActive()[nHeight], nCount);
if (::ChainActive().Tip() == nullptr) return {};
const auto pindex = ::ChainActive().Tip()->GetAncestor(nHeight);
if (pindex == nullptr) return {};
return GetProjectedMNPayees(pindex, nCount);
}

std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayees(const CBlockIndex* const pindex, int nCount) const
Expand Down

0 comments on commit 9568921

Please sign in to comment.