MCPcopy Create free account
hub / github.com/CPChain/chain / AccountConfig

Method AccountConfig

node/config.go:340–365  ·  view source on GitHub ↗

AccountConfig determines the settings for scrypt and keydirectory

()

Source from the content-addressed store, hash-verified

338
339// AccountConfig determines the settings for scrypt and keydirectory
340func (c *Config) AccountConfig() (int, int, string, error) {
341 scryptN := keystore.StandardScryptN
342 scryptP := keystore.StandardScryptP
343 if c.UseLightweightKDF {
344 scryptN = keystore.LightScryptN
345 scryptP = keystore.LightScryptP
346 }
347
348 var (
349 keydir string
350 err error
351 )
352 switch {
353 case filepath.IsAbs(c.KeyStoreDir):
354 keydir = c.KeyStoreDir
355 case c.DataDir != "":
356 if c.KeyStoreDir == "" {
357 keydir = filepath.Join(c.DataDir, datadirDefaultKeyStore)
358 } else {
359 keydir, err = filepath.Abs(c.KeyStoreDir)
360 }
361 case c.KeyStoreDir != "":
362 keydir, err = filepath.Abs(c.KeyStoreDir)
363 }
364 return scryptN, scryptP, keydir, err
365}
366
367func makeAccountManager(conf *Config) (*accounts.Manager, string, error) {
368 scryptN, scryptP, keydir, err := conf.AccountConfig()

Callers 2

createAccountFunction · 0.80
makeAccountManagerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected