Wallet: Avoid treating change-in-the-addressbook as non-change everywhere

This commit is contained in:
Luke Dashjr
2020-02-22 04:16:36 +00:00
parent 8e64b8c84b
commit c751d886f4
5 changed files with 28 additions and 18 deletions

View File

@@ -152,7 +152,7 @@ public:
{
LOCK(m_wallet->cs_wallet);
auto it = m_wallet->m_address_book.find(dest);
if (it == m_wallet->m_address_book.end()) {
if (it == m_wallet->m_address_book.end() || it->second.IsChange()) {
return false;
}
if (name) {
@@ -171,6 +171,7 @@ public:
LOCK(m_wallet->cs_wallet);
std::vector<WalletAddress> result;
for (const auto& item : m_wallet->m_address_book) {
if (item.second.IsChange()) continue;
result.emplace_back(item.first, m_wallet->IsMine(item.first), item.second.name, item.second.purpose);
}
return result;