cmd/utils: don't resolve alloc path if datadir not set

Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
jsvisa 2023-10-09 23:17:33 +00:00
parent 854b9f9113
commit 893e6823e8

View file

@ -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 != "" {
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)