Skip to content

Commit f838f95

Browse files
simplify logic by using the fact that quorumIndex is 0 for non-rotated quorums
1 parent cefbe57 commit f838f95

File tree

1 file changed

+5
-13
lines changed

1 file changed

+5
-13
lines changed

src/evo/simplifiedmns.cpp

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -192,19 +192,11 @@ bool CSimplifiedMNListDiff::BuildQuorumChainlockInfo(const CBlockIndex* blockInd
192192

193193
uint16_t idx = 0;
194194
for (const auto& e : newQuorums) {
195-
auto opt_params = llmq::GetLLMQParams(e.llmqType);
196-
assert(opt_params.has_value());
197-
Consensus::LLMQParams llmq_params = opt_params.value();
198-
auto q = llmq::quorumManager->GetQuorum(e.llmqType, e.quorumHash);
199-
const CBlockIndex* pWorkBaseBlockIndex = nullptr;
200-
if (llmq_params.useRotation) {
201-
// In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the first DKG) - 8
202-
pWorkBaseBlockIndex = blockIndex->GetAncestor(q->m_quorum_base_block_index->nHeight - q->qc->quorumIndex - 8);
203-
}
204-
else {
205-
// In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
206-
pWorkBaseBlockIndex = blockIndex->GetAncestor(q->m_quorum_base_block_index->nHeight - 8);
207-
}
195+
auto quorum = llmq::quorumManager->GetQuorum(e.llmqType, e.quorumHash);
196+
// In case of rotation, all rotated quorums rely on the CL sig expected in the cycleBlock (the block of the first DKG) - 8
197+
// In case of non-rotation, quorums rely on the CL sig expected in the block of the DKG - 8
198+
const CBlockIndex* pWorkBaseBlockIndex =
199+
blockIndex->GetAncestor(quorum->m_quorum_base_block_index->nHeight - quorum->qc->quorumIndex - 8);
208200

209201
workBaseBlockIndexMap.insert(std::make_pair(pWorkBaseBlockIndex, idx));
210202
idx++;

0 commit comments

Comments
 (0)