Downloader: don't setup erigon's config if --dowloader.api.addr is set (#3480)

This commit is contained in:
Alex Sharov 2022-02-11 14:39:28 +07:00 committed by GitHub
parent f66f937d4d
commit dcabe33f33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1362,19 +1362,15 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *node.Config, cfg *ethconfig.Conf
torrentPort = ctx.GlobalInt(TorrentPortFlag.Name)
}
TorrentPortFlag = cli.IntFlag{
Name: "torrent.port",
Value: 42069,
Usage: "port to listen and serve BitTorrent protocol",
if cfg.Snapshot.Enabled && !ctx.GlobalIsSet(DownloaderAddrFlag.Name) {
torrentCfg, pieceCompletion, err := torrentcfg.New(cfg.SnapshotDir, torrentVerbosity, downloadRate, uploadRate, torrentPort)
if err != nil {
panic(err)
}
cfg.Torrent = torrentCfg
cfg.TorrentPieceCompletionStorage = pieceCompletion
}
torrentCfg, pieceCompletion, err := torrentcfg.New(cfg.SnapshotDir, torrentVerbosity, downloadRate, uploadRate, torrentPort)
if err != nil {
panic(err)
}
cfg.Torrent = torrentCfg
cfg.TorrentPieceCompletionStorage = pieceCompletion
if ctx.Command.Name == "import" {
cfg.ImportMode = true
}