From 893e6823e86e79b668495bc1a2a4f113bae66e31 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Mon, 9 Oct 2023 23:17:33 +0000 Subject: [PATCH] cmd/utils: don't resolve alloc path if datadir not set Signed-off-by: jsvisa --- cmd/utils/flags.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index f60d7898b1..7037c0305a 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -1885,7 +1885,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) { var alloc core.GenesisAlloc if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" { - allocPath = stack.ResolvePath(allocPath) + if ctx.IsSet(DataDirFlag.Name) { + allocPath = stack.ResolvePath(allocPath) + } data, err := os.ReadFile(allocPath) if err != nil { Fatalf("Failed to read developer genesis alloc file: %v", err)