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:
@ -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
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user