diff --git a/src/evo/deterministicmns.cpp b/src/evo/deterministicmns.cpp index 5f8536a8c2676..353015fbbfc4f 100644 --- a/src/evo/deterministicmns.cpp +++ b/src/evo/deterministicmns.cpp @@ -356,24 +356,24 @@ CSimplifiedMNListDiff CDeterministicMNList::BuildSimplifiedDiff(const CDetermini diffRet.blockHash = to.blockHash; diffRet.nVersion = llmq::utils::IsV19Active(::ChainActive().Tip()) ? CSimplifiedMNListDiff::BASIC_BLS_VERSION : CSimplifiedMNListDiff::LEGACY_BLS_VERSION; - to.ForEachMN(false, [&](auto& toPtr) { + to.ForEachMN(false, [&](const auto& toPtr) { auto fromPtr = GetMN(toPtr.proTxHash); if (fromPtr == nullptr) { CSimplifiedMNListEntry sme(toPtr); sme.nVersion = diffRet.nVersion; - diffRet.mnList.emplace_back(toPtr); + diffRet.mnList.push_back(std::move(sme)); } else { CSimplifiedMNListEntry sme1(toPtr); CSimplifiedMNListEntry sme2(*fromPtr); sme1.nVersion = diffRet.nVersion; sme2.nVersion = diffRet.nVersion; - if (sme1 != sme2) { - diffRet.mnList.emplace_back(toPtr); - } else if (extended && (sme1.scriptPayout != sme2.scriptPayout || sme1.scriptOperatorPayout != sme2.scriptOperatorPayout)) { - diffRet.mnList.emplace_back(toPtr); + if ((sme1 != sme2) || + (extended && (sme1.scriptPayout != sme2.scriptPayout || sme1.scriptOperatorPayout != sme2.scriptOperatorPayout))) { + diffRet.mnList.push_back(std::move(sme1)); } } }); + ForEachMN(false, [&](auto& fromPtr) { auto toPtr = to.GetMN(fromPtr.proTxHash); if (toPtr == nullptr) {