From 0007f62da54847d376f2f12fb3764280c872c7ce Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Thu, 5 Jun 2025 16:19:47 +0200 Subject: [PATCH] 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. --- cmd/geth/chaincmd.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmd/geth/chaincmd.go b/cmd/geth/chaincmd.go index d8488b8268..e0606f0d0b 100644 --- a/cmd/geth/chaincmd.go +++ b/cmd/geth/chaincmd.go @@ -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 == "" {