diff options
author | Jaquee <jaquee.monero@gmail.com> | 2016-12-12 00:42:46 +0100 |
---|---|---|
committer | Jaquee <jaquee.monero@gmail.com> | 2016-12-12 00:43:02 +0100 |
commit | 5df92877c7c97ad24c4f61e38bc82beb875a7b42 (patch) | |
tree | 57d112b1cb05e3bd48bfd7154c91545c9f497287 /src/wallet/api/wallet.cpp | |
parent | Merge pull request #1422 (diff) | |
download | monero-5df92877c7c97ad24c4f61e38bc82beb875a7b42.tar.xz |
GUI address book
Diffstat (limited to 'src/wallet/api/wallet.cpp')
-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; |