Skip to content

Commit

Permalink
move blockstore read after tick height check
Browse files Browse the repository at this point in the history
  • Loading branch information
AshwinSekar committed Aug 5, 2024
1 parent 3f54bc6 commit 3928df1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions poh/src/poh_recorder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,11 @@ impl PohRecorder {
return PohLeaderStatus::NotReached;
};

if !self.reached_leader_tick(my_pubkey, leader_first_tick_height_including_grace_ticks) {
// PoH hasn't ticked far enough yet.
return PohLeaderStatus::NotReached;
}

if self.blockstore.has_existing_shreds_for_slot(next_poh_slot) {
// We already have existing shreds for this slot. This can happen when this block was previously
// created and added to BankForks, however a recent PoH reset caused this bank to be removed
Expand All @@ -580,11 +585,6 @@ impl PohRecorder {
return PohLeaderStatus::NotReached;
}

if !self.reached_leader_tick(my_pubkey, leader_first_tick_height_including_grace_ticks) {
// PoH hasn't ticked far enough yet.
return PohLeaderStatus::NotReached;
}

assert!(next_tick_height >= self.start_tick_height);
let poh_slot = next_poh_slot;
let parent_slot = self.start_slot();
Expand Down

0 comments on commit 3928df1

Please sign in to comment.