eth/downloader: fix typo in comment (#23413)

pull/23415/head
chuwt 3 years ago committed by GitHub
parent 57feabea66
commit 5566e5d152
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      core/rawdb/freezer.go
  2. 4
      eth/downloader/downloader.go

@ -414,7 +414,7 @@ func (f *freezer) freeze(db ethdb.KeyValueStore) {
} }
batch.Reset() batch.Reset()
// Wipe out side chains also and track dangling side chians // Wipe out side chains also and track dangling side chains
var dangling []common.Hash var dangling []common.Hash
for number := first; number < f.frozen; number++ { for number := first; number < f.frozen; number++ {
// Always keep the genesis block in active database // Always keep the genesis block in active database

@ -465,7 +465,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
} }
if mode == FastSync && pivot == nil { if mode == FastSync && pivot == nil {
// If no pivot block was returned, the head is below the min full block // If no pivot block was returned, the head is below the min full block
// threshold (i.e. new chian). In that case we won't really fast sync // threshold (i.e. new chain). In that case we won't really fast sync
// anyway, but still need a valid pivot block to avoid some code hitting // anyway, but still need a valid pivot block to avoid some code hitting
// nil panics on an access. // nil panics on an access.
pivot = d.blockchain.CurrentBlock().Header() pivot = d.blockchain.CurrentBlock().Header()
@ -681,7 +681,7 @@ func (d *Downloader) fetchHead(p *peerConnection) (head *types.Header, pivot *ty
return head, nil, nil return head, nil, nil
} }
// At this point we have 2 headers in total and the first is the // At this point we have 2 headers in total and the first is the
// validated head of the chian. Check the pivot number and return, // validated head of the chain. Check the pivot number and return,
pivot := headers[1] pivot := headers[1]
if pivot.Number.Uint64() != head.Number.Uint64()-uint64(fsMinFullBlocks) { if pivot.Number.Uint64() != head.Number.Uint64()-uint64(fsMinFullBlocks) {
return nil, nil, fmt.Errorf("%w: remote pivot %d != requested %d", errInvalidChain, pivot.Number, head.Number.Uint64()-uint64(fsMinFullBlocks)) return nil, nil, fmt.Errorf("%w: remote pivot %d != requested %d", errInvalidChain, pivot.Number, head.Number.Uint64()-uint64(fsMinFullBlocks))

Loading…
Cancel
Save