mirror of https://github.com/status-im/op-geth.git
Reverted global
This commit is contained in:
parent
7add66c8bb
commit
6b63759ded
|
@ -201,7 +201,7 @@ func startEth(ctx *cli.Context, eth *eth.Ethereum) {
|
||||||
if len(split) != 2 {
|
if len(split) != 2 {
|
||||||
utils.Fatalf("Illegal 'unlock' format (address:password)")
|
utils.Fatalf("Illegal 'unlock' format (address:password)")
|
||||||
}
|
}
|
||||||
am := utils.GetAccountManager(ctx)
|
am := eth.AccountManager()
|
||||||
// Attempt to unlock the account
|
// Attempt to unlock the account
|
||||||
err := am.Unlock(ethutil.Hex2Bytes(split[0]), split[1])
|
err := am.Unlock(ethutil.Hex2Bytes(split[0]), split[1])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
@ -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
|
return core.NewChainManager(blockDb, stateDb, new(event.TypeMux)), blockDb, stateDb
|
||||||
}
|
}
|
||||||
|
|
||||||
// Global account manager
|
|
||||||
var km *accounts.Manager
|
|
||||||
|
|
||||||
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
|
func GetAccountManager(ctx *cli.Context) *accounts.Manager {
|
||||||
dataDir := ctx.GlobalString(DataDirFlag.Name)
|
dataDir := ctx.GlobalString(DataDirFlag.Name)
|
||||||
if km == nil {
|
ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
|
||||||
ks := crypto.NewKeyStorePassphrase(path.Join(dataDir, "keys"))
|
km := accounts.NewManager(ks)
|
||||||
km = accounts.NewManager(ks)
|
|
||||||
}
|
|
||||||
return km
|
return km
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue