Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Jan 13, 2022
1 parent 8ce6bf9 commit 4fe4520
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions dot/sync/chain_sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,6 @@ func (cs *chainSync) doSync(req *network.BlockRequestMessage, peersTried map[pee
}

func (cs *chainSync) handleReadyBlock(bd *types.BlockData) {
// first check that the block isn't already in the ready queue
if cs.readyBlocks.has(bd.Hash) {
logger.Tracef("ignoring block %s in response, already in ready queue", bd.Hash)
return
Expand All @@ -715,12 +714,11 @@ func (cs *chainSync) handleReadyBlock(bd *types.BlockData) {
// let's check the db as maybe we already processed it
has, err := cs.blockState.HasHeader(bd.Hash)
if err != nil && !errors.Is(err, chaindb.ErrKeyNotFound) {
logger.Debugf("failed to check if header is known for hash %s: err=%s", bd.Hash, err)
logger.Debugf("failed to check if header is known for hash %s: %s", bd.Hash, err)
return
}

if has {
// seems we already processed the block, so let's just return
logger.Tracef("ignoring block we've already processed, hash=%s", bd.Hash)
return
}
Expand Down
2 changes: 1 addition & 1 deletion dot/sync/tip_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

var _ workHandler = &tipSyncer{}

type handleReadyBlockFunc = func(*types.BlockData)
type handleReadyBlockFunc func(*types.BlockData)

// tipSyncer handles workers when syncing at the tip of the chain
type tipSyncer struct {
Expand Down

0 comments on commit 4fe4520

Please sign in to comment.