rent collector improvments (#6888)

* avoid account copying + pre-empt rent

* adding support for base rent
This commit is contained in:
Parth
2019-11-14 10:56:49 +05:30
committed by GitHub
parent c96b8c8d68
commit 7b05b3dbb3
5 changed files with 56 additions and 19 deletions

View File

@@ -114,7 +114,10 @@ impl Accounts {
.filter(|key| !message.program_ids().contains(key))
{
let (account, rent) = AccountsDB::load(storage, ancestors, accounts_index, key)
.and_then(|(account, _)| rent_collector.update(account))
.and_then(|(mut account, _)| {
let rent_due = rent_collector.update(&mut account);
Some((account, rent_due))
})
.unwrap_or_default();
accounts.push(account);