diff options
Diffstat (limited to 'src/wallet/wallet2.cpp')
-rw-r--r-- | src/wallet/wallet2.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index 3dafa56f0..60fa1d266 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -1569,13 +1569,20 @@ bool wallet2::add_address_book_row(const cryptonote::account_public_address &add 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; + int old_size = m_address_book.size(); + m_address_book.push_back(a); + if(m_address_book.size() == old_size+1) + return true; + return false; } bool wallet2::delete_address_book_row(int row_id) { - return (m_address_book.erase(row_id) > 0); + if(m_address_book.size() <= row_id) + return false; + + m_address_book.erase(m_address_book.begin()+row_id); + + return true; } //---------------------------------------------------------------------------------------------------- |