[tests pass] Ensure importprivkey outputs the address in case key is already imported.
This commit is contained in:
@@ -128,8 +128,9 @@ UniValue importprivkey(const UniValue& params, bool fHelp)
|
||||
pwalletMain->SetAddressBook(vchAddress, strLabel, "receive");
|
||||
|
||||
// Don't throw error in case a key is already there
|
||||
if (pwalletMain->HaveKey(vchAddress))
|
||||
return NullUniValue;
|
||||
if (pwalletMain->HaveKey(vchAddress)) {
|
||||
return CBitcoinAddress(vchAddress).ToString();
|
||||
}
|
||||
|
||||
pwalletMain->mapKeyMetadata[vchAddress].nCreateTime = 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user