Skip to content

Commit

Permalink
fix: do not compute hash for blocks (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
itegulov authored Dec 5, 2024
1 parent c0eebfd commit d724465
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/network/header_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct HeaderResponse {
hash: alloy::primitives::BlockHash,
#[serde(flatten)]
inner: crate::network::header::Header,
}
Expand Down Expand Up @@ -98,7 +99,7 @@ impl alloy::consensus::BlockHeader for HeaderResponse {

impl alloy::network::primitives::HeaderResponse for HeaderResponse {
fn hash(&self) -> alloy::primitives::BlockHash {
self.inner.hash_slow()
self.hash
}
}

Expand Down

0 comments on commit d724465

Please sign in to comment.