Skip to content

Commit

Permalink
updates prize when more winners than votes
Browse files Browse the repository at this point in the history
  • Loading branch information
pscott committed Feb 23, 2024
1 parent 162cc0c commit c79a9a5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lottery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ pub async fn cached_lottery_winners(

// Every voter is eligible to the same reward!
if votes.len() <= num_winners as usize {
let prize = boost_info.pool_size / votes.len() as u32;
return Ok(votes.into_iter().map(|v| (v.voter, prize)).collect());
}

Expand Down

0 comments on commit c79a9a5

Please sign in to comment.