Skip to content

Commit

Permalink
fix!: Rotation members calc v19 (#5142)
Browse files Browse the repository at this point in the history
With 18.2, block
`0000000000000044356e582f9748f9baf084e5b7946e6386b32620d540830fda` is
marked invalid with `bad-qc-invalid`.

## Issue being fixed or feature implemented
While the 19 isn’t active -> Calculate rotation members based on 18.1
code
Once 19 active -> Calculate rotation members based on 18.2 code

## What was done?


## How Has This Been Tested?


## Breaking Changes


## Checklist:
- [x] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added or updated relevant unit/integration/functional/e2e
tests
- [ ] I have made corresponding changes to the documentation

**For repository code-owners and collaborators only**
- [x] I have assigned this pull request to a milestone
  • Loading branch information
ogabrielides committed Jan 10, 2023
1 parent 4927135 commit 78593c7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/llmq/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,11 @@ std::vector<std::vector<CDeterministicMNCPtr>> BuildNewQuorumQuarterMembers(cons
auto MnsNotUsedAtH = CDeterministicMNList();
std::vector<CDeterministicMNList> MnsUsedAtHIndexed(nQuorums);

bool skipRemovedMNs = IsV19Active(pQuorumBaseBlockIndex) || (Params().NetworkIDString() == CBaseChainParams::TESTNET);

for (auto i = 0; i < nQuorums; ++i) {
for (const auto& mn : previousQuarters.quarterHMinusC[i]) {
if (!allMns.HasMN(mn->proTxHash)) {
if (skipRemovedMNs && !allMns.HasMN(mn->proTxHash)) {
continue;
}
if (allMns.IsMNPoSeBanned(mn->proTxHash)) {
Expand All @@ -274,7 +276,7 @@ std::vector<std::vector<CDeterministicMNCPtr>> BuildNewQuorumQuarterMembers(cons
}
}
for (const auto& mn : previousQuarters.quarterHMinus2C[i]) {
if (!allMns.HasMN(mn->proTxHash)) {
if (skipRemovedMNs && !allMns.HasMN(mn->proTxHash)) {
continue;
}
if (allMns.IsMNPoSeBanned(mn->proTxHash)) {
Expand All @@ -290,7 +292,7 @@ std::vector<std::vector<CDeterministicMNCPtr>> BuildNewQuorumQuarterMembers(cons
}
}
for (const auto& mn : previousQuarters.quarterHMinus3C[i]) {
if (!allMns.HasMN(mn->proTxHash)) {
if (skipRemovedMNs && !allMns.HasMN(mn->proTxHash)) {
continue;
}
if (allMns.IsMNPoSeBanned(mn->proTxHash)) {
Expand Down

0 comments on commit 78593c7

Please sign in to comment.