forked from cerc-io/plugeth
Merge pull request #22122 from karalabe/snapshot-polishes
cmd/utils, eth/downloader: minor snap nitpicks
This commit is contained in:
commit
8bd8e1b24a
@ -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 snap-sync is requested, this flag is also required
|
||||||
if cfg.SyncMode == downloader.SnapSync {
|
if cfg.SyncMode == downloader.SnapSync {
|
||||||
log.Info("Snap sync requested, enabling --snapshot")
|
log.Info("Snap sync requested, enabling --snapshot")
|
||||||
ctx.Set(SnapshotFlag.Name, "true")
|
|
||||||
} else {
|
} else {
|
||||||
cfg.TrieCleanCache += cfg.SnapshotCache
|
cfg.TrieCleanCache += cfg.SnapshotCache
|
||||||
cfg.SnapshotCache = 0 // Disabled
|
cfg.SnapshotCache = 0 // Disabled
|
||||||
|
@ -89,7 +89,7 @@ var (
|
|||||||
errCancelContentProcessing = errors.New("content processing canceled (requested)")
|
errCancelContentProcessing = errors.New("content processing canceled (requested)")
|
||||||
errCanceled = errors.New("syncing canceled (requested)")
|
errCanceled = errors.New("syncing canceled (requested)")
|
||||||
errNoSyncActive = errors.New("no sync active")
|
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 {
|
type Downloader struct {
|
||||||
@ -460,7 +460,7 @@ func (d *Downloader) syncWithPeer(p *peerConnection, hash common.Hash, td *big.I
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
if p.version < 64 {
|
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()
|
mode := d.getMode()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user