aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/utils
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-03-12 00:47:17 +0800
committerobscuren <geffobscura@gmail.com>2015-03-12 00:47:17 +0800
commit587f748d929e0c76d9b43e74d70cafb8f614fad0 (patch)
tree4f48bbeaab928f18113ecd0a9a4fb10483fa8e6a /cmd/utils
parent239e17de126a3d7afa29da7ee423ffc79757877f (diff)
parent629f4b1d3cadcf1d43892ae2a0152fec3d185396 (diff)
downloadgo-tangerine-587f748d929e0c76d9b43e74d70cafb8f614fad0.tar.gz
go-tangerine-587f748d929e0c76d9b43e74d70cafb8f614fad0.tar.zst
go-tangerine-587f748d929e0c76d9b43e74d70cafb8f614fad0.zip
Merge branch 'fjl-unencrypted-keys' into develop
Diffstat (limited to 'cmd/utils')
-rw-r--r--cmd/utils/flags.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go
index 6372aaa42..5c188a41e 100644
--- a/cmd/utils/flags.go
+++ b/cmd/utils/flags.go
@@ -99,6 +99,10 @@ var (
Name: "mine",
Usage: "Enable mining",
}
+ UnencryptedKeysFlag = cli.BoolFlag{
+ Name: "unencrypted-keys",
+ Usage: "disable private key disk encryption (for testing)",
+ }
LogFileFlag = cli.StringFlag{
Name: "logfile",
@@ -224,9 +228,13 @@ func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.D
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
dataDir := ctx.GlobalString(DataDirFlag.Name)
- ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
- km := accounts.NewManager(ks)
- return km
+ var ks crypto.KeyStore2
+ if ctx.GlobalBool(UnencryptedKeysFlag.Name) {
+ ks = crypto.NewKeyStorePlain(path.Join(dataDir, "plainkeys"))
+ } else {
+ ks = crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
+ }
+ return accounts.NewManager(ks)
}
func StartRPC(eth *eth.Ethereum, ctx *cli.Context) {