diff options
author | Riccardo Spagni <ric@spagni.net> | 2016-12-12 22:39:38 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2016-12-12 22:39:38 +0200 |
commit | aa7a926681fbb97b796e8fde5792eca3e67eacb0 (patch) | |
tree | 9a41eee577076adffb97e2c1b3dc3a2634d24779 /src/wallet/api/wallet.cpp | |
parent | Merge pull request #1433 (diff) | |
parent | GUI address book (diff) | |
download | monero-aa7a926681fbb97b796e8fde5792eca3e67eacb0.tar.xz |
Merge pull request #1434
5df92877 GUI address book (Jaquee)
Diffstat (limited to '')
-rw-r--r-- | src/wallet/api/wallet.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp index a772498cd..0a2f0f680 100644 --- a/src/wallet/api/wallet.cpp +++ b/src/wallet/api/wallet.cpp @@ -32,11 +32,13 @@ #include "wallet.h" #include "pending_transaction.h" #include "transaction_history.h" +#include "address_book.h" #include "common_defines.h" #include "mnemonics/electrum-words.h" #include <boost/format.hpp> #include <sstream> +#include <unordered_map> using namespace std; using namespace cryptonote; @@ -209,6 +211,7 @@ WalletImpl::WalletImpl(bool testnet) m_wallet->callback(m_wallet2Callback); m_refreshThreadDone = false; m_refreshEnabled = false; + m_addressBook = new AddressBookImpl(this); m_refreshIntervalMillis = DEFAULT_REFRESH_INTERVAL_MILLIS; @@ -223,6 +226,7 @@ WalletImpl::~WalletImpl() { stopRefresh(); delete m_history; + delete m_addressBook; delete m_wallet; delete m_wallet2Callback; } @@ -327,9 +331,7 @@ bool WalletImpl::close() bool result = false; LOG_PRINT_L3("closing wallet..."); try { - // do not store wallet with invalid status - if (status() == Status_Ok) - m_wallet->store(); + m_wallet->store(); LOG_PRINT_L3("wallet::store done"); LOG_PRINT_L3("Calling wallet::stop..."); m_wallet->stop(); @@ -823,6 +825,11 @@ TransactionHistory *WalletImpl::history() const return m_history; } +AddressBook *WalletImpl::addressBook() const +{ + return m_addressBook; +} + void WalletImpl::setListener(WalletListener *l) { // TODO thread synchronization; |