Skip to content

Commit

Permalink
Add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
carllin committed Feb 5, 2025
1 parent a7e96d1 commit 4869b24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion programs/vote/src/vote_account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ impl VoteAccounts {
.map(|(stake, vote_account)| (*vote_account.node_pubkey(), stake))
.into_grouping_map()
.aggregate(|acc: Option<u64>, _node_pubkey, stake| {
Some(acc.unwrap_or_default().checked_add(*stake).unwrap())
Some(
acc.unwrap_or_default()
.checked_add(*stake)
.expect("Overflow in stake addition"),
)
}),
)
})
Expand Down

0 comments on commit 4869b24

Please sign in to comment.