diff options
Diffstat (limited to 'src/qt/walletmodel.cpp')
-rw-r--r-- | src/qt/walletmodel.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/qt/walletmodel.cpp b/src/qt/walletmodel.cpp index 0fb7d21087..f962b9a7c7 100644 --- a/src/qt/walletmodel.cpp +++ b/src/qt/walletmodel.cpp @@ -122,3 +122,19 @@ TransactionTableModel *WalletModel::getTransactionTableModel() { return transactionTableModel; } + +/* Look up label for address in address book, if not found return empty string. + */ +QString WalletModel::labelForAddress(const QString &address) const +{ + CRITICAL_BLOCK(wallet->cs_mapAddressBook) + { + std::map<std::string, std::string>::iterator mi = wallet->mapAddressBook.find(address.toStdString()); + if (mi != wallet->mapAddressBook.end()) + { + return QString::fromStdString(mi->second); + } + } + return QString(); +} + |