mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
fix: adjust payee predictions after mn_rr activation
This commit is contained in:
parent
d8fca38404
commit
9d47cd2226
@ -215,7 +215,9 @@ std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayees(gsl
|
||||
if (nCount < 0 ) {
|
||||
return {};
|
||||
}
|
||||
const auto weighted_count = GetValidWeightedMNsCount();
|
||||
const bool isMNRewardReallocation = DeploymentActiveAfter(pindexPrev, Params().GetConsensus(),
|
||||
Consensus::DEPLOYMENT_MN_RR);
|
||||
const auto weighted_count = isMNRewardReallocation ? GetValidMNsCount() : GetValidWeightedMNsCount();
|
||||
nCount = std::min(nCount, int(weighted_count));
|
||||
|
||||
std::vector<CDeterministicMNCPtr> result;
|
||||
@ -223,7 +225,6 @@ std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayees(gsl
|
||||
|
||||
int remaining_evo_payments{0};
|
||||
CDeterministicMNCPtr evo_to_be_skipped{nullptr};
|
||||
const bool isMNRewardReallocation{DeploymentActiveAfter(pindexPrev, Params().GetConsensus(), Consensus::DEPLOYMENT_MN_RR)};
|
||||
if (!isMNRewardReallocation) {
|
||||
ForEachMNShared(true, [&](const CDeterministicMNCPtr& dmn) {
|
||||
if (dmn->pdmnState->nLastPaidHeight == nHeight) {
|
||||
@ -242,7 +243,7 @@ std::vector<CDeterministicMNCPtr> CDeterministicMNList::GetProjectedMNPayees(gsl
|
||||
|
||||
ForEachMNShared(true, [&](const CDeterministicMNCPtr& dmn) {
|
||||
if (dmn == evo_to_be_skipped) return;
|
||||
for ([[maybe_unused]] auto _ : irange::range(GetMnType(dmn->nType).voting_weight)) {
|
||||
for ([[maybe_unused]] auto _ : irange::range(isMNRewardReallocation ? 1 : GetMnType(dmn->nType).voting_weight)) {
|
||||
result.emplace_back(dmn);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user