Skip to content

Commit

Permalink
fix on_header_received hook (#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdallas authored and hashmap committed Jul 16, 2019
1 parent b8c508d commit a1c7f30
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions servers/src/common/adapters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ impl p2p::ChainAdapter for NetToChainAdapter {
bh: core::BlockHeader,
peer_info: &PeerInfo,
) -> Result<bool, chain::Error> {
let bhash = bh.hash();
debug!(
"Received block header {} at {} from {}, going to process.",
bhash, bh.height, peer_info.addr,
);
if !self.sync_state.is_syncing() {
for hook in &self.hooks {
hook.on_header_received(&bh, &peer_info.addr);
}
}

// pushing the new block header through the header chain pipeline
// we will go ask for the block if this is a new header
Expand All @@ -251,7 +251,7 @@ impl p2p::ChainAdapter for NetToChainAdapter {
.process_block_header(&bh, self.chain_opts(false));

if let Err(e) = res {
debug!("Block header {} refused by chain: {:?}", bhash, e.kind());
debug!("Block header {} refused by chain: {:?}", bh.hash(), e.kind());
if e.is_bad_data() {
return Ok(false);
} else {
Expand Down

0 comments on commit a1c7f30

Please sign in to comment.