aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet2.cpp
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-12-12 22:39:38 +0200
committerRiccardo Spagni <ric@spagni.net>2016-12-12 22:39:38 +0200
commitaa7a926681fbb97b796e8fde5792eca3e67eacb0 (patch)
tree9a41eee577076adffb97e2c1b3dc3a2634d24779 /src/wallet/wallet2.cpp
parentMerge pull request #1433 (diff)
parentGUI address book (diff)
downloadmonero-aa7a926681fbb97b796e8fde5792eca3e67eacb0.tar.xz
Merge pull request #1434
5df92877 GUI address book (Jaquee)
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 fabf642f1..3dafa56f0 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)
{