diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index 09aa8e7834..a72da97941 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -67,8 +67,8 @@ type KeyStore struct { updateScope event.SubscriptionScope // Subscription scope tracking current live listeners updating bool // Whether the event notification loop is running - mu sync.RWMutex - impMu sync.RWMutex // Import Mutex locks the import to prevent two insertions from racing + mu sync.RWMutex + importMu sync.RWMutex // Import Mutex locks the import to prevent two insertions from racing } type unlocked struct { @@ -444,8 +444,8 @@ func (ks *KeyStore) Import(keyJSON []byte, passphrase, newPassphrase string) (ac if err != nil { return accounts.Account{}, err } - ks.impMu.Lock() - defer ks.impMu.Unlock() + ks.importMu.Lock() + defer ks.importMu.Unlock() if ks.cache.hasAddress(key.Address) { return accounts.Account{}, fmt.Errorf("account already exists") } @@ -455,8 +455,8 @@ func (ks *KeyStore) Import(keyJSON []byte, passphrase, newPassphrase string) (ac // ImportECDSA stores the given key into the key directory, encrypting it with the passphrase. func (ks *KeyStore) ImportECDSA(priv *ecdsa.PrivateKey, passphrase string) (accounts.Account, error) { key := newKeyFromECDSA(priv) - ks.impMu.Lock() - defer ks.impMu.Unlock() + ks.importMu.Lock() + defer ks.importMu.Unlock() if ks.cache.hasAddress(key.Address) { return accounts.Account{}, fmt.Errorf("account already exists") }