Consolidate entry tick verification into one function (#7740)

* Consolidate entry tick verification into one function

* Mark bad slots as dead in blocktree processor

* more feedback

* Add bank.is_complete

* feedback
This commit is contained in:
Justin Starry
2020-01-15 09:15:26 +08:00
committed by GitHub
parent 721c4378c1
commit ff1ca1e0d3
9 changed files with 369 additions and 382 deletions

View File

@ -902,6 +902,10 @@ impl Bank {
}
}
pub fn is_complete(&self) -> bool {
self.tick_height() == self.max_tick_height()
}
pub fn is_block_boundary(&self, tick_height: u64) -> bool {
tick_height % self.ticks_per_slot == 0
}

View File

@ -20,7 +20,7 @@ fn test_race_register_tick_freeze() {
let freeze_thread = Builder::new()
.name("freeze".to_string())
.spawn(move || loop {
if bank0_.tick_height() == bank0_.max_tick_height() {
if bank0_.is_complete() {
assert_eq!(bank0_.last_blockhash(), hash);
break;
}