check for unregistered players

This commit is contained in:
conduition
2024-03-09 16:28:26 +00:00
parent 8d99ec6f6c
commit 050b1bda8a

View File

@@ -120,11 +120,16 @@ impl ContractParameters {
return Err(Error);
}
// Check for zero payout weights.
for &weight in payout_map.values() {
for (player, &weight) in payout_map.iter() {
// Check for zero payout weights.
if weight == 0 {
return Err(Error);
}
// Check for unregistered players.
if !self.players.contains(player) {
return Err(Error);
}
}
}