Skip to content

Commit

Permalink
[api] fix wrong calculation of bonds funding (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
ochaloup authored Dec 10, 2024
1 parent 793c6ed commit 2c0edab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions common-rs/src/funded_bonds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ pub async fn collect_validator_bonds_with_funds(
log::info!("Found witdraw requests: {}", witdraw_requests.len());
log::info!("Found settlements: {}", settlements.len());

for (pubkey, _, stake_account) in stake_accounts {
for (pubkey, lamports_available, stake_account) in stake_accounts {
if let Some(lockup) = stake_account.lockup() {
if lockup.is_in_force(&clock, None) {
log::warn!("Lockup is in force {pubkey}");
}
}
if let Some(delegation) = stake_account.delegation() {
let funded_bond = validator_funds.entry(delegation.voter_pubkey).or_default();
funded_bond.funded_amount += delegation.stake;
funded_bond.effective_amount += delegation.stake;
funded_bond.funded_amount += lamports_available;
funded_bond.effective_amount += lamports_available;
}
}

Expand Down

0 comments on commit 2c0edab

Please sign in to comment.