|
1 | 1 | use std::collections::BTreeSet; |
2 | 2 | use crate::hash_types::QuorumModifierHash; |
3 | | -use crate::network::message_qrinfo::MNSkipListMode; |
| 3 | +use crate::network::message_qrinfo::{MNSkipListMode, QRInfo}; |
4 | 4 | use crate::prelude::CoreBlockHeight; |
5 | 5 | use crate::sml::llmq_type::LLMQParams; |
6 | 6 | use crate::sml::llmq_type::rotation::{LLMQQuarterReconstructionType, LLMQQuarterUsageType}; |
@@ -34,13 +34,13 @@ impl MasternodeListEngine { |
34 | 34 | Ok(rotated_members) |
35 | 35 | } |
36 | 36 |
|
37 | | - pub fn required_cl_sig_heights(&self) -> Result<BTreeSet<u32>, QuorumValidationError> { |
| 37 | + pub fn required_cl_sig_heights(&self, qrinfo: &QRInfo) -> Result<BTreeSet<u32>, QuorumValidationError> { |
38 | 38 | let mut required_heights = BTreeSet::new(); |
39 | | - for quorum in &self.last_commitment_entries { |
40 | | - let Some(quorum_block_height) = self.block_heights.get(&quorum.quorum_entry.quorum_hash) else { |
41 | | - return Err(QuorumValidationError::RequiredBlockNotPresent(quorum.quorum_entry.quorum_hash)); |
| 39 | + for quorum in &qrinfo.last_commitment_per_index { |
| 40 | + let Some(quorum_block_height) = self.block_heights.get(&quorum.quorum_hash) else { |
| 41 | + return Err(QuorumValidationError::RequiredBlockNotPresent(quorum.quorum_hash)); |
42 | 42 | }; |
43 | | - let llmq_params = quorum.quorum_entry.llmq_type.params(); |
| 43 | + let llmq_params = quorum.llmq_type.params(); |
44 | 44 | let quorum_index = quorum_block_height % llmq_params.dkg_params.interval; |
45 | 45 | let cycle_base_height = quorum_block_height - quorum_index; |
46 | 46 | let cycle_length = llmq_params.dkg_params.interval; |
|
0 commit comments