Skip to content

Commit

Permalink
fix: core 18 quorums
Browse files Browse the repository at this point in the history
  • Loading branch information
pankcuf committed Nov 5, 2023
1 parent 2622a3f commit f6de4c3
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 161 deletions.
8 changes: 4 additions & 4 deletions dash-spv-masternode-processor/src/models/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ impl LLMQSnapshot {
match self.skip_list_mode {
LLMQSnapshotSkipMode::NoSkipping => {
let mut iter = sorted_combined_mns_list.iter();
(0..quorum_count).for_each(|_i| {
(0..quorum_count).for_each(|i| {
let mut quarter = Vec::<MasternodeEntry>::new();
while quarter.len() < quarter_size {
if let Some(node) = iter.next() {
Expand All @@ -112,7 +112,7 @@ impl LLMQSnapshot {
iter = sorted_combined_mns_list.iter();
}
}
quarter_quorum_members.push(quarter);
quarter_quorum_members[i] = quarter;
});
}
LLMQSnapshotSkipMode::SkipFirst => {
Expand Down Expand Up @@ -143,7 +143,7 @@ impl LLMQSnapshot {
}
}
LLMQSnapshotSkipMode::SkipExcept => {
(0..quorum_count).for_each(|_i| {
(0..quorum_count).for_each(|i| {
let mut quarter = Vec::<MasternodeEntry>::new();
self.skip_list.iter().for_each(|unskipped| {
if let Some(node) = sorted_combined_mns_list.get(*unskipped as usize) {
Expand All @@ -152,7 +152,7 @@ impl LLMQSnapshot {
}
}
});
quarter_quorum_members.push(quarter);
quarter_quorum_members[i] = quarter;
});
}
LLMQSnapshotSkipMode::SkipAll => {
Expand Down
5 changes: 1 addition & 4 deletions dash-spv-masternode-processor/src/processing/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -590,10 +590,8 @@ impl MasternodeProcessor {
//Self::log_masternodes(quarter_nodes, format!("••••• PREV QUARTER {} ••••••• ", i));
for node in quarter_nodes {
let hash = node.provider_registration_transaction_hash;
// let skip = skip_removed_masternodes && !masternode_list.has_masternode(node.provider_registration_transaction_hash);
if (!skip_removed_masternodes || masternode_list.has_masternode(hash)) &&
masternode_list.has_valid_masternode(hash) {
// node.is_valid {
if !used_at_h_masternodes.iter().any(|m| m.provider_registration_transaction_hash == hash) {
used_at_h_masternodes.push(node.clone());
}
Expand All @@ -606,8 +604,7 @@ impl MasternodeProcessor {
}
}
masternode_list.masternodes.values().for_each(|mn| {
if mn.is_valid && !used_at_h_masternodes.iter()
.any(|node| mn.provider_registration_transaction_hash == node.provider_registration_transaction_hash) {
if mn.is_valid && !used_at_h_masternodes.iter().any(|node| mn.provider_registration_transaction_hash == node.provider_registration_transaction_hash) {
unused_at_h_masternodes.push(mn.clone());
}
});
Expand Down
Loading

0 comments on commit f6de4c3

Please sign in to comment.