Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix on_header_received hook not firing #2953

Merged
merged 1 commit into from
Jul 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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