1818#include < node/blockstorage.h>
1919#include < serialize.h>
2020#include < univalue.h>
21- #include < validation.h>
2221#include < util/enumerate.h>
22+ #include < validation.h>
2323
2424using node::ReadBlockFromDisk;
2525
@@ -68,9 +68,10 @@ bool CSimplifiedMNListDiff::BuildQuorumsDiff(const CBlockIndex* baseBlockIndex,
6868
6969bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo (const llmq::CQuorumManager& qman, const CBlockIndex* blockIndex)
7070{
71- // Group quorums (indexes corresponding to entries of newQuorums) per CBlockIndex containing the expected CL signature in CbTx.
72- // We want to avoid to load CbTx now, as more than one quorum will target the same block: hence we want to load CbTxs once per block (heavy operation).
73- std::multimap<const CBlockIndex*, uint16_t > workBaseBlockIndexMap;
71+ // Group quorums (indexes corresponding to entries of newQuorums) per CBlockIndex containing the expected CL
72+ // signature in CbTx. We want to avoid to load CbTx now, as more than one quorum will target the same block: hence
73+ // we want to load CbTxs once per block (heavy operation).
74+ std::multimap<const CBlockIndex*, uint16_t > workBaseBlockIndexMap;
7475
7576 for (const auto [idx, e] : enumerate(newQuorums)) {
7677 // We assume that we have on hand, quorums that correspond to the hashes queried.
@@ -83,10 +84,10 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager&
8384 return false ;
8485 }
8586
86- // In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the first DKG) - 8
87- // In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
88- const CBlockIndex* pWorkBaseBlockIndex =
89- blockIndex-> GetAncestor (quorum-> m_quorum_base_block_index -> nHeight - quorum->qc ->quorumIndex - 8 );
87+ // In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the
88+ // first DKG) - 8 In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
89+ const CBlockIndex* pWorkBaseBlockIndex = blockIndex-> GetAncestor (quorum-> m_quorum_base_block_index -> nHeight -
90+ quorum->qc ->quorumIndex - 8 );
9091
9192 workBaseBlockIndexMap.insert (std::make_pair (pWorkBaseBlockIndex, idx));
9293 }
@@ -102,7 +103,8 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const llmq::CQuorumManager&
102103 // Get the range of indexes (values) for the current key and merge them into a single std::set
103104 const auto [it_begin, it_end] = workBaseBlockIndexMap.equal_range (it->first );
104105 std::set<uint16_t > idx_set;
105- std::transform (it_begin, it_end, std::inserter (idx_set, idx_set.end ()), [](const auto & pair) { return pair.second ; });
106+ std::transform (it_begin, it_end, std::inserter (idx_set, idx_set.end ()),
107+ [](const auto & pair) { return pair.second ; });
106108 // Advance the iterator to the next key
107109 it = it_end;
108110
@@ -130,9 +132,9 @@ CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& from, cons
130132 } else {
131133 CSimplifiedMNListEntry sme1 (toPtr);
132134 CSimplifiedMNListEntry sme2 (*fromPtr);
133- if ((sme1 != sme2) ||
134- (extended && (sme1. scriptPayout != sme2. scriptPayout || sme1.scriptOperatorPayout != sme2.scriptOperatorPayout ))) {
135- diffRet.mnList .push_back (std::move (sme1));
135+ if ((sme1 != sme2) || (extended && (sme1. scriptPayout != sme2. scriptPayout ||
136+ sme1.scriptOperatorPayout != sme2.scriptOperatorPayout ))) {
137+ diffRet.mnList .push_back (std::move (sme1));
136138 }
137139 }
138140 });
@@ -147,8 +149,9 @@ CSimplifiedMNListDiff BuildSimplifiedDiff(const CDeterministicMNList& from, cons
147149 return diffRet;
148150}
149151
150- bool BuildSimplifiedMNListDiff (CDeterministicMNManager& dmnman, const ChainstateManager& chainman, const llmq::CQuorumBlockProcessor& qblockman,
151- const llmq::CQuorumManager& qman, const uint256& baseBlockHash, const uint256& blockHash,
152+ bool BuildSimplifiedMNListDiff (CDeterministicMNManager& dmnman, const ChainstateManager& chainman,
153+ const llmq::CQuorumBlockProcessor& qblockman, const llmq::CQuorumManager& qman,
154+ const uint256& baseBlockHash, const uint256& blockHash,
152155 CSimplifiedMNListDiff& mnListDiffRet, std::string& errorRet, bool extended)
153156{
154157 AssertLockHeld (::cs_main);
0 commit comments