Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/evo/cbtx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ bool CalcCbTxMerkleRootMNList(const CBlock& block, const CBlockIndex* pindexPrev
int64_t nTime2 = GetTimeMicros(); nTimeDMN += nTime2 - nTime1;
LogPrint(BCLog::BENCHMARK, " - BuildNewListFromBlock: %.2fms [%.2fs]\n", 0.001 * (nTime2 - nTime1), nTimeDMN * 0.000001);

CSimplifiedMNList sml(tmpMNList);
bool v19active = llmq::utils::IsV19Active(pindexPrev);
CSimplifiedMNList sml(tmpMNList, v19active);

int64_t nTime3 = GetTimeMicros(); nTimeSMNL += nTime3 - nTime2;
LogPrint(BCLog::BENCHMARK, " - CSimplifiedMNList: %.2fms [%.2fs]\n", 0.001 * (nTime3 - nTime2), nTimeSMNL * 0.000001);
Expand Down
8 changes: 5 additions & 3 deletions src/evo/simplifiedmns.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,15 @@ CSimplifiedMNList::CSimplifiedMNList(const std::vector<CSimplifiedMNListEntry>&
});
}

CSimplifiedMNList::CSimplifiedMNList(const CDeterministicMNList& dmnList)
CSimplifiedMNList::CSimplifiedMNList(const CDeterministicMNList& dmnList, bool isV19Active)
{
mnList.resize(dmnList.GetAllMNsCount());

size_t i = 0;
dmnList.ForEachMN(false, [this, &i](auto& dmn) {
mnList[i++] = std::make_unique<CSimplifiedMNListEntry>(dmn);
dmnList.ForEachMN(false, [this, &i, isV19Active](auto& dmn) {
auto sme = std::make_unique<CSimplifiedMNListEntry>(dmn);
sme->nVersion = isV19Active ? CSimplifiedMNListEntry::BASIC_BLS_VERSION : CSimplifiedMNListEntry::LEGACY_BLS_VERSION;
mnList[i++] = std::move(sme);
});

std::sort(mnList.begin(), mnList.end(), [&](const std::unique_ptr<CSimplifiedMNListEntry>& a, const std::unique_ptr<CSimplifiedMNListEntry>& b) {
Expand Down
5 changes: 3 additions & 2 deletions src/evo/simplifiedmns.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class CSimplifiedMNListEntry
service == rhs.service &&
pubKeyOperator == rhs.pubKeyOperator &&
keyIDVoting == rhs.keyIDVoting &&
isValid == rhs.isValid;
isValid == rhs.isValid &&
nVersion == rhs.nVersion;
}

bool operator!=(const CSimplifiedMNListEntry& rhs) const
Expand Down Expand Up @@ -79,7 +80,7 @@ class CSimplifiedMNList

CSimplifiedMNList() = default;
explicit CSimplifiedMNList(const std::vector<CSimplifiedMNListEntry>& smlEntries);
explicit CSimplifiedMNList(const CDeterministicMNList& dmnList);
explicit CSimplifiedMNList(const CDeterministicMNList& dmnList, bool isV19Active);

uint256 CalcMerkleRoot(bool* pmutated = nullptr) const;
bool operator==(const CSimplifiedMNList& rhs) const;
Expand Down
2 changes: 1 addition & 1 deletion src/test/util/setup_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ struct TestChainDIP3Setup : public TestChainSetup

struct TestChainDIP3V19Setup : public TestChainSetup
{
TestChainDIP3V19Setup() : TestChainSetup(900) {}
TestChainDIP3V19Setup() : TestChainSetup(1000) {}
};

struct TestChainDIP3BeforeActivationSetup : public TestChainSetup
Expand Down