Skip to content

Commit

Permalink
Initialize genesis block with cashed hash
Browse files Browse the repository at this point in the history
  • Loading branch information
fiaxh authored and jsdanielh committed Nov 23, 2024
1 parent d77793c commit c276299
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions genesis/src/networks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ impl NetworkInfo {

#[inline]
pub fn genesis_block(&self) -> Block {
Block::deserialize_from_vec(self.genesis.block)
.expect("Failed to deserialize genesis block.")
let mut block = Block::deserialize_from_vec(self.genesis.block)
.expect("Failed to deserialize genesis block.");
block.populate_cached_hash(self.genesis.hash.clone());
block
}

#[inline]
Expand Down

0 comments on commit c276299

Please sign in to comment.