mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 01:13:45 +00:00
node: Remove superfluous code
This commit is contained in:
parent
8c752cccfd
commit
1adadea161
1 changed files with 3 additions and 28 deletions
|
|
@ -359,6 +359,7 @@ func (c *Config) parsePersistentNodes(path string) []*discover.Node {
|
||||||
}
|
}
|
||||||
return nodes
|
return nodes
|
||||||
}
|
}
|
||||||
|
|
||||||
// ResolveAccountConfig determines the settings for scrypt and keydirectory
|
// ResolveAccountConfig determines the settings for scrypt and keydirectory
|
||||||
func ResolveAccountConfig(conf *Config) (int, int, string, error) {
|
func ResolveAccountConfig(conf *Config) (int, int, string, error) {
|
||||||
scryptN := keystore.StandardScryptN
|
scryptN := keystore.StandardScryptN
|
||||||
|
|
@ -391,34 +392,8 @@ func ResolveAccountConfig(conf *Config) (int, int, string, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
|
func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
|
||||||
scryptN := keystore.StandardScryptN
|
scryptN, scryptP, keydir, err := ResolveAccountConfig(conf)
|
||||||
scryptP := keystore.StandardScryptP
|
|
||||||
if conf.UseLightweightKDF {
|
|
||||||
scryptN = keystore.LightScryptN
|
|
||||||
scryptP = keystore.LightScryptP
|
|
||||||
}
|
|
||||||
|
|
||||||
var (
|
|
||||||
keydir string
|
|
||||||
ephemeral string
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
switch {
|
|
||||||
case filepath.IsAbs(conf.KeyStoreDir):
|
|
||||||
keydir = conf.KeyStoreDir
|
|
||||||
case conf.DataDir != "":
|
|
||||||
if conf.KeyStoreDir == "" {
|
|
||||||
keydir = filepath.Join(conf.DataDir, datadirDefaultKeyStore)
|
|
||||||
} else {
|
|
||||||
keydir, err = filepath.Abs(conf.KeyStoreDir)
|
|
||||||
}
|
|
||||||
case conf.KeyStoreDir != "":
|
|
||||||
keydir, err = filepath.Abs(conf.KeyStoreDir)
|
|
||||||
default:
|
|
||||||
// There is no datadir.
|
|
||||||
keydir, err = ioutil.TempDir("", "go-ethereum-keystore")
|
|
||||||
ephemeral = keydir
|
|
||||||
}
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, "", err
|
return nil, "", err
|
||||||
}
|
}
|
||||||
|
|
@ -443,5 +418,5 @@ func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
|
||||||
backends = append(backends, trezorhub)
|
backends = append(backends, trezorhub)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return accounts.NewManager(backends...), ephemeral, nil
|
return accounts.NewManager(backends...), keydir, nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue