From 6b63759ded5766396029445af772e35e3b8c1c67 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 11 Mar 2015 16:33:04 +0100 Subject: [PATCH] Reverted global --- cmd/ethereum/main.go | 2 +- cmd/utils/flags.go | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/cmd/ethereum/main.go b/cmd/ethereum/main.go index c9f620142..10d9c8fa4 100644 --- a/cmd/ethereum/main.go +++ b/cmd/ethereum/main.go @@ -201,7 +201,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) { if len(split) != 2 { utils.Fatalf("Illegal 'unlock' format (address:password)") } - am := utils.GetAccountManager(ctx) + am := eth.AccountManager() // Attempt to unlock the account err := am.Unlock(ethutil.Hex2Bytes(split[0]), split[1]) if err != nil { diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index 2c7d37942..6372aaa42 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -222,15 +222,10 @@ func GetChain(ctx *cli.Context) (*core.ChainManager, ethutil.Database, ethutil.D return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb } -// Global account manager -var km *accounts.Manager - func GetAccountManager(ctx *cli.Context) *accounts.Manager { dataDir := ctx.GlobalString(DataDirFlag.Name) - if km == nil { - ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys")) - km = accounts.NewManager(ks) - } + ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys")) + km := accounts.NewManager(ks) return km }