mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-02 09:46:52 -05:00
refactor: getAddress don't access m_address_book, use FindAddressEntry function
This commit is contained in:
parent
a05876619a
commit
192eb1e61c
1 changed files with 4 additions and 6 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue