plumb some rent (#5610)

* plumb some rent

* nits

* fixups

* fixups

* fixups
This commit is contained in:
Rob Walker
2019-08-23 14:04:53 -07:00
committed by GitHub
parent 9b8d59d2e9
commit 0ffe7a9c8f
19 changed files with 385 additions and 143 deletions

View File

@@ -1,8 +1,7 @@
use bincode::{deserialize_from, serialize_into, serialized_size};
use memmap::MmapMut;
use serde::{Deserialize, Serialize};
use solana_sdk::account::Account;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::{account::Account, pubkey::Pubkey, Epoch};
use std::fmt;
use std::fs::{create_dir_all, remove_file, OpenOptions};
use std::io;
@@ -38,6 +37,8 @@ pub struct AccountBalance {
pub owner: Pubkey,
/// this account's data contains a loaded program (and is now read-only)
pub executable: bool,
/// the epoch at which this account will next owe rent
pub rent_epoch: Epoch,
}
/// References to Memory Mapped memory
@@ -57,6 +58,7 @@ impl<'a> StoredAccount<'a> {
lamports: self.balance.lamports,
owner: self.balance.owner,
executable: self.balance.executable,
rent_epoch: self.balance.rent_epoch,
data: self.data.to_vec(),
}
}
@@ -281,6 +283,7 @@ impl AppendVec {
lamports: account.lamports,
owner: account.owner,
executable: account.executable,
rent_epoch: account.rent_epoch,
};
let balance_ptr = &balance as *const AccountBalance;
let data_len = storage_meta.data_len as usize;