Browse Source

[tests pass] Ensure `importprivkey` outputs the address in case key is already imported.

pull/40/head^2
Nathan Wilcox 7 years ago
parent
commit
de422c066b
  1. 5
      src/wallet/rpcdump.cpp

5
src/wallet/rpcdump.cpp

@ -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;

Loading…
Cancel
Save