Add checkpoint, rollback to to bank (#1662)

add linked-list capability to accounts

change accounts from a linked list to a VecDeque

add checkpoint and rollback for lastids

add subscriber notifications for rollbacks

checkpoint transaction count, too
This commit is contained in:
Rob Walker
2018-11-05 09:47:41 -08:00
committed by GitHub
parent 5a85cc4626
commit 1fbf1d2cf2
14 changed files with 385 additions and 191 deletions

View File

@@ -13,10 +13,12 @@ pub fn id() -> Pubkey {
Pubkey::new(&ERC20_PROGRAM_ID)
}
pub fn populate_account(account: &mut Account) {
account.tokens = 0;
account.program_id = id();
account.userdata = ERC20_NAME.as_bytes().to_vec();
account.executable = true;
account.loader_program_id = native_loader::id();
pub fn account() -> Account {
Account {
tokens: 0,
program_id: id(),
userdata: ERC20_NAME.as_bytes().to_vec(),
executable: true,
loader_program_id: native_loader::id(),
}
}