Add methods to adjust rent burn percentage, and hashes per tick

This commit is contained in:
Michael Vines 2020-08-26 13:39:26 -07:00
parent 76be36c9ce
commit 450c667aa7
1 changed files with 8 additions and 10 deletions

View File

@ -679,16 +679,6 @@ impl Bank {
);
assert_eq!(bank.epoch_schedule, genesis_config.epoch_schedule);
assert_eq!(bank.epoch, bank.epoch_schedule.get_epoch(bank.slot));
assert_eq!(
bank.rent_collector,
RentCollector::new(
bank.epoch,
&bank.epoch_schedule,
bank.slots_per_year,
&genesis_config.rent,
genesis_config.operating_mode,
)
);
bank
}
@ -1249,6 +1239,14 @@ impl Bank {
self.message_processor.set_compute_budget(budget);
}
pub fn set_rent_burn_percentage(&mut self, burn_percent: u8) {
self.rent_collector.rent.burn_percent = burn_percent;
}
pub fn set_hashes_per_tick(&mut self, hashes_per_tick: Option<u64>) {
self.hashes_per_tick = hashes_per_tick;
}
/// Return the last block hash registered.
pub fn last_blockhash(&self) -> Hash {
self.blockhash_queue.read().unwrap().last_hash()