cmd/utils: avoid large alloc in --dev mode (#22949)

* cmd/utils: avoid 1Gb alloc in --dev mode

* cmd/geth: avoid 512Mb alloc in genesis query tests
This commit is contained in:
Martin Holst Swende
2021-05-27 10:13:35 +02:00
committed by GitHub
parent 5869789d75
commit 2e7714f864
2 changed files with 5 additions and 1 deletions

View File

@ -1234,6 +1234,9 @@ func SetNodeConfig(ctx *cli.Context, cfg *node.Config) {
if ctx.GlobalIsSet(KeyStoreDirFlag.Name) {
cfg.KeyStoreDir = ctx.GlobalString(KeyStoreDirFlag.Name)
}
if ctx.GlobalIsSet(DeveloperFlag.Name) {
cfg.UseLightweightKDF = true
}
if ctx.GlobalIsSet(LightKDFFlag.Name) {
cfg.UseLightweightKDF = ctx.GlobalBool(LightKDFFlag.Name)
}
@ -1647,6 +1650,7 @@ func SetEthConfig(ctx *cli.Context, stack *node.Node, cfg *ethconfig.Config) {
if !ctx.GlobalIsSet(NetworkIdFlag.Name) {
cfg.NetworkId = 1337
}
cfg.SyncMode = downloader.FullSync
// Create new developer account or reuse existing one
var (
developer accounts.Account