fix!: Rotation members calc v19 (#5142)

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
This commit is contained in:
Odysseas Gabrielides 2023-01-10 23:14:27 +02:00 committed by pasta
parent 60946b660c
commit 5eab2ce0ed
No known key found for this signature in database
GPG Key ID: 52527BEDABE87984

View File

@ -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)) {
@ -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)) {
@ -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)) {