diff --git a/node/src/chain/header_validation.rs b/node/src/chain/header_validation.rs index 791d7ad175..20a111b94d 100644 --- a/node/src/chain/header_validation.rs +++ b/node/src/chain/header_validation.rs @@ -167,12 +167,6 @@ impl<'a, DB: database::DB> Validator<'a, DB> { return Ok(vec![]); } - let prev_block_seed = self.db.read().await.view(|v| { - v.fetch_block_header(&self.prev_header.prev_block_hash)? - .ok_or_else(|| anyhow::anyhow!("Header not found")) - .map(|h| h.seed) - })?; - let cert_result = candidate_block.prev_block_cert.result; let prev_block_hash = candidate_block.prev_block_hash; @@ -184,6 +178,12 @@ impl<'a, DB: database::DB> Validator<'a, DB> { ), } + let prev_block_seed = self.db.read().await.view(|v| { + v.fetch_block_header(&self.prev_header.prev_block_hash)? + .ok_or_else(|| anyhow::anyhow!("Header not found")) + .map(|h| h.seed) + })?; + let (_, _, voters) = verify_att( &candidate_block.prev_block_cert, self.prev_header.get_consensus_header(),