Fix importmulti bug when importing an already imported key

Github-Pull: #11483
Rebased-From: a44a215177
This commit is contained in:
Pedro Branco
2017-10-11 11:12:59 +01:00
committed by MarcoFalke
parent 405e069d3b
commit 20cdc2b36c
2 changed files with 13 additions and 1 deletions

View File

@@ -960,7 +960,7 @@ UniValue ProcessImport(CWallet * const pwallet, const UniValue& data, const int6
pwallet->SetAddressBook(vchAddress, label, "receive");
if (pwallet->HaveKey(vchAddress)) {
return false;
throw JSONRPCError(RPC_WALLET_ERROR, "The wallet already contains the private key for this address or script");
}
pwallet->mapKeyMetadata[vchAddress].nCreateTime = timestamp;