From 3928df1212087ed77886f800fafd9913768f399c Mon Sep 17 00:00:00 2001 From: Ashwin Sekar Date: Mon, 5 Aug 2024 23:22:51 +0000 Subject: [PATCH] move blockstore read after tick height check --- poh/src/poh_recorder.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/poh/src/poh_recorder.rs b/poh/src/poh_recorder.rs index 24f2ff7b981b86..fab2d9f62559e6 100644 --- a/poh/src/poh_recorder.rs +++ b/poh/src/poh_recorder.rs @@ -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 @@ -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();