Skip to content

Commit

Permalink
node: move prev_block_seed
Browse files Browse the repository at this point in the history
  • Loading branch information
fed-franz committed Jul 23, 2024
1 parent bb53aa7 commit 1254c94
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions node/src/chain/header_validation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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(),
Expand Down

0 comments on commit 1254c94

Please sign in to comment.