Skip to content

Commit 8c7e952

Browse files
committed
Since Mn reward relocation no quad rewards for evo MN (hpmn)
1 parent aa7d171 commit 8c7e952

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/evo/deterministicmns.cpp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ CDeterministicMNCPtr CDeterministicMNList::GetMNPayee(const CBlockIndex* pIndex)
183183
}
184184

185185
bool isv19Active = llmq::utils::IsV19Active(pIndex);
186+
bool isMNRRActive = llmq::utils::IsMNRewardReallocationActive(pIndex);
187+
CDeterministicMNCPtr best{nullptr};
186188
// Starting from v19 and until v20 (Platform release), HPMN will be rewarded 4 blocks in a row
187-
// TODO: Skip this code once v20 is active
188-
CDeterministicMNCPtr best = nullptr;
189-
if (isv19Active) {
189+
if (isv19Active && !isMNRRActive) {
190190
ForEachMNShared(true, [&](const CDeterministicMNCPtr& dmn) {
191191
if (dmn->pdmnState->nLastPaidHeight == nHeight) {
192192
// We found the last MN Payee.
@@ -721,6 +721,9 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
721721

722722
DecreasePoSePenalties(newList);
723723

724+
bool isv19Active = llmq::utils::IsV19Active(pindexPrev);
725+
bool isMNRRActive = llmq::utils::IsMNRewardReallocationActive(pindexPrev);
726+
724727
// we skip the coinbase
725728
for (int i = 1; i < (int)block.vtx.size(); i++) {
726729
const CTransaction& tx = *block.vtx[i];
@@ -736,7 +739,7 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
736739
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-protx-payload");
737740
}
738741

739-
if (proTx.nType == MnType::HighPerformance && !llmq::utils::IsV19Active(pindexPrev)) {
742+
if (proTx.nType == MnType::HighPerformance && !isv19Active) {
740743
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-protx-payload");
741744
}
742745

@@ -799,7 +802,7 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
799802
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-protx-payload");
800803
}
801804

802-
if (proTx.nType == MnType::HighPerformance && !llmq::utils::IsV19Active(pindexPrev)) {
805+
if (proTx.nType == MnType::HighPerformance && !isv19Active) {
803806
return state.Invalid(BlockValidationResult::BLOCK_CONSENSUS, "bad-protx-payload");
804807
}
805808

@@ -940,9 +943,8 @@ bool CDeterministicMNManager::BuildNewListFromBlock(const CBlock& block, const C
940943
newState->nLastPaidHeight = nHeight;
941944
// Starting from v19 and until v20, HPMN will be paid 4 blocks in a row
942945
// No need to check if v19 is active, since HPMN ProRegTx are allowed only after v19 activation
943-
// TODO: Skip this code once v20 is active
944946
// Note: If the payee wasn't found in the current block that's fine
945-
if (dmn->nType == MnType::HighPerformance) {
947+
if (dmn->nType == MnType::HighPerformance && !isMNRRActive) {
946948
++newState->nConsecutivePayments;
947949
if (debugLogs) {
948950
LogPrint(BCLog::MNPAYMENTS, "CDeterministicMNManager::%s -- MN %s is a HPMN, bumping nConsecutivePayments to %d\n",

0 commit comments

Comments
 (0)