rewrite vote credits redemption to eat from rewards_pools on an epoch-sensitive basis (#4775)

* move redemption to rewards pools

* rewrite redemption, touch a few other things

* re-establish test coverage
This commit is contained in:
Rob Walker
2019-06-21 20:43:24 -07:00
committed by GitHub
parent f39e74f0d7
commit a49f5378e2
12 changed files with 570 additions and 553 deletions

View File

@ -417,7 +417,7 @@ impl Bank {
fn update_slot_hashes(&self) {
let mut account = self
.get_account(&slot_hashes::id())
.unwrap_or_else(|| slot_hashes::create_account(1));
.unwrap_or_else(|| slot_hashes::create_account(1, &[]));
let mut slot_hashes = SlotHashes::from(&account).unwrap();
slot_hashes.add(self.slot(), self.hash());
@ -546,6 +546,10 @@ impl Bank {
self.capitalization
.fetch_add(account.lamports as usize, Ordering::Relaxed);
}
for (pubkey, account) in genesis_block.rewards_pools.iter() {
self.store_account(pubkey, account);
}
// highest staked node is the first collector
self.collector_id = self
.stakes