mirror of
https://github.com/mimblewimble/grin.git
synced 2025-02-01 17:01:09 +03:00
fix on_header_received hook (#2953)
This commit is contained in:
parent
b8c508d255
commit
a1c7f304bd
1 changed files with 6 additions and 6 deletions
|
@ -238,11 +238,11 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||||
bh: core::BlockHeader,
|
bh: core::BlockHeader,
|
||||||
peer_info: &PeerInfo,
|
peer_info: &PeerInfo,
|
||||||
) -> Result<bool, chain::Error> {
|
) -> Result<bool, chain::Error> {
|
||||||
let bhash = bh.hash();
|
if !self.sync_state.is_syncing() {
|
||||||
debug!(
|
for hook in &self.hooks {
|
||||||
"Received block header {} at {} from {}, going to process.",
|
hook.on_header_received(&bh, &peer_info.addr);
|
||||||
bhash, bh.height, peer_info.addr,
|
}
|
||||||
);
|
}
|
||||||
|
|
||||||
// pushing the new block header through the header chain pipeline
|
// pushing the new block header through the header chain pipeline
|
||||||
// we will go ask for the block if this is a new header
|
// we will go ask for the block if this is a new header
|
||||||
|
@ -251,7 +251,7 @@ impl p2p::ChainAdapter for NetToChainAdapter {
|
||||||
.process_block_header(&bh, self.chain_opts(false));
|
.process_block_header(&bh, self.chain_opts(false));
|
||||||
|
|
||||||
if let Err(e) = res {
|
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() {
|
if e.is_bad_data() {
|
||||||
return Ok(false);
|
return Ok(false);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue