Replay should respect order of register_ticks with respect to blockhashes (#6805)

This commit is contained in:
carllin
2019-11-08 11:29:41 -08:00
committed by Michael Vines
parent f8e64aad5b
commit 66a0f54097
2 changed files with 43 additions and 2 deletions

View File

@ -796,7 +796,7 @@ impl Bank {
// assert!(!self.is_frozen());
inc_new_counter_debug!("bank-register_tick-registered", 1);
let current_tick_height = self.tick_height.fetch_add(1, Ordering::Relaxed) as u64;
if current_tick_height % self.ticks_per_slot == self.ticks_per_slot - 1 {
if self.is_block_boundary(current_tick_height + 1) {
self.blockhash_queue
.write()
.unwrap()
@ -804,6 +804,10 @@ impl Bank {
}
}
pub fn is_block_boundary(&self, tick_height: u64) -> bool {
tick_height % self.ticks_per_slot == 0
}
/// Process a Transaction. This is used for unit tests and simply calls the vector
/// Bank::process_transactions method
pub fn process_transaction(&self, tx: &Transaction) -> Result<()> {