cmd/geth: make account commands not require datadir lock (#27084)

Makes the `geth account ... ` commands usable even if a geth-process is already executing, since the account commands do not read the chaindata, it was not required for those to use the same locking mechanism. 

---
Signed-off-by: jsvisa <delweng@gmail.com>
Co-authored-by: Martin Holst Swende <martin@swende.se>
Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This commit is contained in:
Delweng
2023-04-27 06:57:29 -04:00
committed by GitHub
co-authored by Martin Holst Swende Sina Mahmoodi
parent 66c0c4e517
commit 8f373227ac
4 changed files with 53 additions and 33 deletions
+3 -3
View File
@@ -448,10 +448,10 @@ func (c *Config) KeyDirConfig() (string, error) {
return keydir, err
}
// getKeyStoreDir retrieves the key directory and will create
// GetKeyStoreDir retrieves the key directory and will create
// and ephemeral one if necessary.
func getKeyStoreDir(conf *Config) (string, bool, error) {
keydir, err := conf.KeyDirConfig()
func (c *Config) GetKeyStoreDir() (string, bool, error) {
keydir, err := c.KeyDirConfig()
if err != nil {
return "", false, err
}
+1 -1
View File
@@ -119,7 +119,7 @@ func New(conf *Config) (*Node, error) {
if err := node.openDataDir(); err != nil {
return nil, err
}
keyDir, isEphem, err := getKeyStoreDir(conf)
keyDir, isEphem, err := conf.GetKeyStoreDir()
if err != nil {
return nil, err
}