diff options
author | Luke Dashjr <luke-jr+git@utopios.org> | 2020-02-22 04:16:36 +0000 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2020-04-02 16:25:17 +0000 |
commit | c751d886f499257627b308b11ffaa51c22db6cc0 (patch) | |
tree | da16f6fe7552691501c4ae52e191c2e8f0931a4f /src/wallet/rpcdump.cpp | |
parent | 8e64b8c84bcbd63caea06f3af087af1f0609eaf5 (diff) |
Wallet: Avoid treating change-in-the-addressbook as non-change everywhere
Diffstat (limited to 'src/wallet/rpcdump.cpp')
-rw-r--r-- | src/wallet/rpcdump.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet/rpcdump.cpp b/src/wallet/rpcdump.cpp index 1348f6091b..40ea51e464 100644 --- a/src/wallet/rpcdump.cpp +++ b/src/wallet/rpcdump.cpp @@ -60,7 +60,8 @@ static bool GetWalletAddressesForKey(LegacyScriptPubKeyMan* spk_man, const CWall CKey key; spk_man->GetKey(keyid, key); for (const auto& dest : GetAllDestinationsForKey(key.GetPubKey())) { - if (pwallet->m_address_book.count(dest)) { + const auto* address_book_entry = pwallet->FindAddressBookEntry(dest); + if (address_book_entry) { if (!strAddr.empty()) { strAddr += ","; } @@ -168,7 +169,7 @@ UniValue importprivkey(const JSONRPCRequest& request) // label all new addresses, and label existing addresses if a // label was passed. for (const auto& dest : GetAllDestinationsForKey(pubkey)) { - if (!request.params[1].isNull() || pwallet->m_address_book.count(dest) == 0) { + if (!request.params[1].isNull() || !pwallet->FindAddressBookEntry(dest)) { pwallet->SetAddressBook(dest, strLabel, "receive"); } } |