aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wallet/wallet.cpp')
-rw-r--r--src/wallet/wallet.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index ab36dacf37..b4cbcfd005 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1237,8 +1237,9 @@ bool CWallet::IsChange(const CScript& script) const
return true;
LOCK(cs_wallet);
- if (!m_address_book.count(address))
+ if (!FindAddressBookEntry(address)) {
return true;
+ }
}
return false;
}
@@ -3192,7 +3193,7 @@ bool CWallet::SetAddressBookWithDB(WalletBatch& batch, const CTxDestination& add
{
LOCK(cs_wallet);
std::map<CTxDestination, CAddressBookData>::iterator mi = m_address_book.find(address);
- fUpdated = mi != m_address_book.end();
+ fUpdated = (mi != m_address_book.end() && !mi->second.IsChange());
m_address_book[address].SetLabel(strName);
if (!strPurpose.empty()) /* update purpose only if requested */
m_address_book[address].purpose = strPurpose;
@@ -3459,6 +3460,7 @@ std::set<CTxDestination> CWallet::GetLabelAddresses(const std::string& label) co
std::set<CTxDestination> result;
for (const std::pair<const CTxDestination, CAddressBookData>& item : m_address_book)
{
+ if (item.second.IsChange()) continue;
const CTxDestination& address = item.first;
const std::string& strName = item.second.name;
if (strName == label)