cmd/geth: fix era1 download location to match store (#31951)

This changes the era1 downloader to place the files into the correct
location where geth will actually use them. Also adds integration with
the new --datadir.era flag.
This commit is contained in:
Felix Lange 2025-06-05 16:19:47 +02:00 committed by GitHub
parent 4bb097b7ff
commit 0007f62da5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -723,8 +723,12 @@ func downloadEra(ctx *cli.Context) error {
// Resolve the destination directory.
stack, _ := makeConfigNode(ctx)
defer stack.Close()
ancients := stack.ResolveAncient("chaindata", "")
dir := filepath.Join(ancients, "era")
dir := filepath.Join(ancients, rawdb.ChainFreezerName, "era")
if ctx.IsSet(utils.EraFlag.Name) {
dir = filepath.Join(ancients, ctx.String(utils.EraFlag.Name))
}
baseURL := ctx.String(eraServerFlag.Name)
if baseURL == "" {