Skip to content

Commit

Permalink
Merge pull request #22122 from karalabe/snapshot-polishes
Browse files Browse the repository at this point in the history
cmd/utils, eth/downloader: minor snap nitpicks
  • Loading branch information
karalabe authored Jan 7, 2021
2 parents d2e1b17 + 83d317c commit 8bd8e1b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,6 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *eth.Config) {
// If snap-sync is requested, this flag is also required
if cfg.SyncMode == downloader.SnapSync {
log.Info("Snap sync requested, enabling --snapshot")
ctx.Set(SnapshotFlag.Name, "true")
} else {
cfg.TrieCleanCache += cfg.SnapshotCache
cfg.SnapshotCache = 0 // Disabled
Expand Down
4 changes: 2 additions & 2 deletions eth/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var (
errCancelContentProcessing = errors.New("content processing canceled (requested)")
errCanceled = errors.New("syncing canceled (requested)")
errNoSyncActive = errors.New("no sync active")
errTooOld = errors.New("peer doesn't speak recent enough protocol version (need version >= 64)")
errTooOld = errors.New("peer's protocol version too old")
)

type Downloader struct {
Expand Down Expand Up @@ -460,7 +460,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
}
}()
if p.version < 64 {
return fmt.Errorf("%w, peer version: %d", errTooOld, p.version)
return fmt.Errorf("%w: advertized %d < required %d", errTooOld, p.version, 64)
}
mode := d.getMode()

Expand Down

0 comments on commit 8bd8e1b

Please sign in to comment.