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