diff options
author | Felix Lange <fjl@twurst.com> | 2015-10-29 01:54:50 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2015-10-29 01:54:50 +0800 |
commit | 56f8699a6c6bfe613d2ab28c47631a1f4a29e36f (patch) | |
tree | 704b8897b7a0751fb6e7043bc8cc2baec923a496 /cmd | |
parent | 6b5a42a15ca54749d41c0b29b4a26ebb3a1a53f0 (diff) | |
parent | 05ea8926c32a97d9f193a69076037b7a704d6d92 (diff) | |
download | dexon-56f8699a6c6bfe613d2ab28c47631a1f4a29e36f.tar.gz dexon-56f8699a6c6bfe613d2ab28c47631a1f4a29e36f.tar.zst dexon-56f8699a6c6bfe613d2ab28c47631a1f4a29e36f.zip |
Merge pull request #1940 from wildfjre/lightkdfflag
cmd/utils, crypto: add --lightkdf flag for lighter KDF
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/utils/flags.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 79c86c52a..c2b92be46 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -157,6 +157,10 @@ var ( Name: "fast", Usage: "Enables fast syncing through state downloads", } + LightKDFFlag = cli.BoolFlag{ + Name: "lightkdf", + Usage: "Reduce KDF memory & CPU usage at some expense of KDF strength", + } // miner settings // TODO: refactor CPU vs GPU mining flags @@ -579,7 +583,13 @@ func MakeAccountManager(ctx *cli.Context) *accounts.Manager { if ctx.GlobalBool(TestNetFlag.Name) { dataDir += "/testnet" } - ks := crypto.NewKeyStorePassphrase(filepath.Join(dataDir, "keystore")) + scryptN := crypto.StandardScryptN + scryptP := crypto.StandardScryptP + if ctx.GlobalBool(LightKDFFlag.Name) { + scryptN = crypto.LightScryptN + scryptP = crypto.LightScryptP + } + ks := crypto.NewKeyStorePassphrase(filepath.Join(dataDir, "keystore"), scryptN, scryptP) return accounts.NewManager(ks) } |