Only process votes for players who have active deposits.

This commit is contained in:
FiveMovesAhead 2025-01-05 11:13:24 +08:00
parent 3138f31c00
commit 715da6cd69

View File

@ -148,6 +148,7 @@ pub(crate) async fn update(cache: &mut AddBlockCache) {
let active_algorithm_ids = &block_data.active_ids[&ActiveType::Algorithm];
let active_breakthrough_ids = &block_data.active_ids[&ActiveType::Breakthrough];
let active_challenge_ids = &block_data.active_ids[&ActiveType::Challenge];
let active_player_ids = &block_data.active_ids[&ActiveType::Player];
// update votes
for breakthrough_state in voting_breakthroughs_state.values_mut() {
@ -156,7 +157,8 @@ pub(crate) async fn update(cache: &mut AddBlockCache) {
(false, PreciseNumber::from(0)),
]);
}
for (player_id, player_state) in active_players_state.iter() {
for player_id in active_player_ids.iter() {
let player_state = &active_players_state[player_id];
let player_data = &active_players_block_data[player_id];
for (breakthrough_id, vote) in player_state.votes.iter() {
let yes = vote.value;