diff --git a/accounts/keystore/keystore.go b/accounts/keystore/keystore.go index 5b55175b1f..28669a61a4 100644 --- a/accounts/keystore/keystore.go +++ b/accounts/keystore/keystore.go @@ -443,6 +443,9 @@ func (ks *KeyStore) Import(keyJSON []byte, passphrase, newPassphrase string) (ac if err != nil { return accounts.Account{}, err } + if ks.cache.hasAddress(key.Address) { + return accounts.Account{}, fmt.Errorf("account already exists") + } return ks.importKey(key, newPassphrase) }