aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorfurszy <matiasfurszyfer@protonmail.com>2022-06-11 10:45:08 -0300
committerfurszy <matiasfurszyfer@protonmail.com>2022-06-14 11:51:37 -0300
commit192eb1e61c3c43baec7f32c498ab0ce0656a58f7 (patch)
treed8d55f755e1047fd9f6423ea54e194bc362dd22f /src/wallet
parenta05876619a3307daefec0946de8e3cbbe5b0157f (diff)
refactor: getAddress don't access m_address_book, use FindAddressEntry function
Diffstat (limited to 'src/wallet')
-rw-r--r--src/wallet/interfaces.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/wallet/interfaces.cpp b/src/wallet/interfaces.cpp
index e1203817e0..5cfcf16e16 100644
--- a/src/wallet/interfaces.cpp
+++ b/src/wallet/interfaces.cpp
@@ -191,18 +191,16 @@ public:
std::string* purpose) override
{
LOCK(m_wallet->cs_wallet);
- auto it = m_wallet->m_address_book.find(dest);
- if (it == m_wallet->m_address_book.end() || it->second.IsChange()) {
- return false;
- }
+ const auto& entry = m_wallet->FindAddressBookEntry(dest, /*allow_change=*/false);
+ if (!entry) return false; // addr not found
if (name) {
- *name = it->second.GetLabel();
+ *name = entry->GetLabel();
}
if (is_mine) {
*is_mine = m_wallet->IsMine(dest);
}
if (purpose) {
- *purpose = it->second.purpose;
+ *purpose = entry->purpose;
}
return true;
}