wallet_api: segfault on refresh fixed

This commit is contained in:
Ilya Kitaev 2016-07-13 13:13:10 +03:00
parent 9d2cb4f36c
commit 10c06ddac7
2 changed files with 9 additions and 5 deletions

View file

@ -634,8 +634,8 @@ void WalletImpl::doRefresh()
std::lock_guard<std::mutex> guarg(m_refreshMutex2); std::lock_guard<std::mutex> guarg(m_refreshMutex2);
try { try {
m_wallet->refresh(); m_wallet->refresh();
if (m_walletListener) { if (m_wallet2Callback->getListener()) {
m_walletListener->refreshed(); m_wallet2Callback->getListener()->refreshed();
} }
} catch (const std::exception &e) { } catch (const std::exception &e) {
m_status = Status_Error; m_status = Status_Error;

View file

@ -189,10 +189,14 @@ struct Wallet
static std::string genPaymentId(); static std::string genPaymentId();
static bool paymentIdValid(const std::string &paiment_id); static bool paymentIdValid(const std::string &paiment_id);
// TODO? /**
// virtual uint64_t unlockedDustBalance() const = 0; * @brief refresh - refreshes the wallet, updating transactions from daemon
* @return - true if refreshed successfully;
*/
virtual bool refresh() = 0; virtual bool refresh() = 0;
/**
* @brief refreshAsync - refreshes wallet asynchronously.
*/
virtual void refreshAsync() = 0; virtual void refreshAsync() = 0;
/*! /*!
* \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored * \brief createTransaction creates transaction. if dst_addr is an integrated address, payment_id is ignored