mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
cmd/utils: don't resolve alloc path if datadir not set
Signed-off-by: jsvisa <delweng@gmail.com>
This commit is contained in:
parent
854b9f9113
commit
893e6823e8
1 changed files with 3 additions and 1 deletions
|
|
@ -1885,7 +1885,9 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
|
||||||
|
|
||||||
var alloc core.GenesisAlloc
|
var alloc core.GenesisAlloc
|
||||||
if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" {
|
if allocPath := ctx.Path(DeveloperAllocFlag.Name); allocPath != "" {
|
||||||
|
if ctx.IsSet(DataDirFlag.Name) {
|
||||||
allocPath = stack.ResolvePath(allocPath)
|
allocPath = stack.ResolvePath(allocPath)
|
||||||
|
}
|
||||||
data, err := os.ReadFile(allocPath)
|
data, err := os.ReadFile(allocPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
Fatalf("Failed to read developer genesis alloc file: %v", err)
|
Fatalf("Failed to read developer genesis alloc file: %v", err)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue