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

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

(cherry picked from commit 66a0f54097)

* Remove merge conflict
This commit is contained in:
mergify[bot]
2019-11-08 18:35:50 -07:00
committed by Michael Vines
parent 5766359cde
commit b414d151b8
2 changed files with 43 additions and 2 deletions

View File

@@ -811,7 +811,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()
@@ -819,6 +819,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, and commits credit-only credits.
pub fn process_transaction(&self, tx: &Transaction) -> Result<()> {