aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/api/address_book.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2021-05-12 16:55:38 -0500
committerluigi1111 <luigi1111w@gmail.com>2021-05-12 16:55:38 -0500
commita080c0be9c5da26011ec715d158c1430ef99b3e8 (patch)
treeebff5394dc25ed38a1b3f209ccf5db383a41bde4 /src/wallet/api/address_book.cpp
parentMerge pull request #7680 (diff)
parentwallet_api: import / export output function (diff)
downloadmonero-a080c0be9c5da26011ec715d158c1430ef99b3e8.tar.xz
Merge pull request #7678
dedcd63 wallet_api: import / export output function (tobtoht) 6e22710 expose set_offline to wallet api (benevanoff) 02e9a41 wallet_api: add isDeterministic() (tobtoht) def5819 wallet_api: add seed_offset param to seed() (tobtoht) 73959c6 wallet_api: store fee for incoming txs in history (Ben Evanoff) 712f362 wallet api: allow wallet to fetch all key images via api (benevanoff) 153d08d Allow tx note edits via TransactionHistory object in wallet/api (dsc) 2abd7b1 wallet_api: TransactionHistory - fill unconfirmed out payments dests (xiphon) 9a50bef Extend TransactionInfo with coinbase and description attributes in wallet/api (dsc) 22bb6a6 Allow AddressBook description edits via wallet/api interface (dsc)
Diffstat (limited to 'src/wallet/api/address_book.cpp')
-rw-r--r--src/wallet/api/address_book.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wallet/api/address_book.cpp b/src/wallet/api/address_book.cpp
index f69a69ca3..96090d9f5 100644
--- a/src/wallet/api/address_book.cpp
+++ b/src/wallet/api/address_book.cpp
@@ -70,6 +70,25 @@ bool AddressBookImpl::addRow(const std::string &dst_addr , const std::string &pa
return r;
}
+bool AddressBookImpl::setDescription(std::size_t index, const std::string &description)
+{
+ clearStatus();
+
+ const auto ab = m_wallet->m_wallet->get_address_book();
+ if (index >= ab.size()){
+ return false;
+ }
+
+ tools::wallet2::address_book_row entry = ab[index];
+ entry.m_description = description;
+ bool r = m_wallet->m_wallet->set_address_book_row(index, entry.m_address, NULL, entry.m_description, entry.m_is_subaddress);
+ if (r)
+ refresh();
+ else
+ m_errorCode = General_Error;
+ return r;
+}
+
void AddressBookImpl::refresh()
{
LOG_PRINT_L2("Refreshing addressbook");