Skip to content

Commit

Permalink
Reduce cap by rent's leftover as temporary measure
Browse files Browse the repository at this point in the history
  • Loading branch information
ryoqun committed Sep 8, 2020
1 parent c67f8bd commit f6a123f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ impl Bank {
&self,
vote_account_hashmap: &HashMap<Pubkey, (u64, Account)>,
rent_to_be_distributed: u64,
) {
) -> u64 {
let mut total_staked = 0;
let mut rent_distributed_in_initial_round = 0;

Expand Down Expand Up @@ -2082,6 +2082,7 @@ impl Bank {
account.lamports += rent_to_be_paid;
self.store_account(&pubkey, &account);
});
leftover_lamports
}

fn distribute_rent(&self) {
Expand All @@ -2099,7 +2100,9 @@ impl Bank {
return;
}

self.distribute_rent_to_validators(&self.vote_accounts(), rent_to_be_distributed);
let leftover =
self.distribute_rent_to_validators(&self.vote_accounts(), rent_to_be_distributed);
self.capitalization.fetch_sub(leftover, Ordering::Relaxed);
}

fn collect_rent(
Expand Down

0 comments on commit f6a123f

Please sign in to comment.