aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2016-12-12 00:42:46 +0100
committerJaquee <jaquee.monero@gmail.com>2016-12-12 00:43:02 +0100
commit5df92877c7c97ad24c4f61e38bc82beb875a7b42 (patch)
tree57d112b1cb05e3bd48bfd7154c91545c9f497287 /src/wallet/wallet2.cpp
parentMerge pull request #1422 (diff)
downloadmonero-5df92877c7c97ad24c4f61e38bc82beb875a7b42.tar.xz
GUI address book
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r--src/wallet/wallet2.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp
index 81472687d..a113c929e 100644
--- a/src/wallet/wallet2.cpp
+++ b/src/wallet/wallet2.cpp
@@ -1561,6 +1561,23 @@ void wallet2::fast_refresh(uint64_t stop_height, uint64_t &blocks_start_height,
}
}
+
+bool wallet2::add_address_book_row(const cryptonote::account_public_address &address, const crypto::hash &payment_id, const std::string &description)
+{
+ wallet2::address_book_row a;
+ a.m_address = address;
+ a.m_payment_id = payment_id;
+ a.m_description = description;
+
+ int key = (m_address_book.empty())? 0 : m_address_book.rbegin()->first;
+ bool r = m_address_book.emplace(++key,a).second;
+ return r;
+}
+
+bool wallet2::delete_address_book_row(int row_id) {
+ return (m_address_book.erase(row_id) > 0);
+}
+
//----------------------------------------------------------------------------------------------------
void wallet2::refresh(uint64_t start_height, uint64_t & blocks_fetched, bool& received_money)
{