aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaquee <jaquee.monero@gmail.com>2017-01-30 11:59:19 +0100
committerJaquee <jaquee.monero@gmail.com>2017-02-04 23:25:03 +0100
commit805625b5412e0c37bf7008e4f1a9b75b40a6fd06 (patch)
tree079d19f8f64001709be21854095e8440a5a8030d
parentwallet2::init() - disconnect before init if connected (diff)
downloadmonero-805625b5412e0c37bf7008e4f1a9b75b40a6fd06.tar.xz
wallet api: Remove initAsync() and don't start refresh automatically on init
-rw-r--r--src/wallet/api/wallet.cpp15
-rw-r--r--src/wallet/api/wallet.h4
-rw-r--r--src/wallet/wallet2_api.h18
3 files changed, 6 insertions, 31 deletions
diff --git a/src/wallet/api/wallet.cpp b/src/wallet/api/wallet.cpp
index 9e40d2e02..deab4fe1f 100644
--- a/src/wallet/api/wallet.cpp
+++ b/src/wallet/api/wallet.cpp
@@ -515,7 +515,6 @@ bool WalletImpl::recover(const std::string &path, const std::string &seed)
try {
m_wallet->set_seed_language(old_language);
m_wallet->generate(path, "", recovery_key, true, false);
- // TODO: wallet->init(daemon_address);
} catch (const std::exception &e) {
m_status = Status_Critical;
@@ -646,19 +645,7 @@ string WalletImpl::keysFilename() const
bool WalletImpl::init(const std::string &daemon_address, uint64_t upper_transaction_size_limit)
{
clearStatus();
- if (!doInit(daemon_address, upper_transaction_size_limit))
- return false;
- bool result = this->refresh();
- // enabling background refresh thread
- startRefresh();
- return result;
-}
-
-void WalletImpl::initAsync(const string &daemon_address, uint64_t upper_transaction_size_limit)
-{
- clearStatus();
- doInit(daemon_address, upper_transaction_size_limit);
- startRefresh();
+ return doInit(daemon_address, upper_transaction_size_limit);
}
void WalletImpl::setRefreshFromBlockHeight(uint64_t refresh_from_block_height)
diff --git a/src/wallet/api/wallet.h b/src/wallet/api/wallet.h
index 7daf63e43..3994afaa3 100644
--- a/src/wallet/api/wallet.h
+++ b/src/wallet/api/wallet.h
@@ -78,8 +78,7 @@ public:
bool store(const std::string &path);
std::string filename() const;
std::string keysFilename() const;
- bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit);
- void initAsync(const std::string &daemon_address, uint64_t upper_transaction_size_limit);
+ bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit = 0);
bool connectToDaemon();
ConnectionStatus connected() const;
void setTrustedDaemon(bool arg);
@@ -135,7 +134,6 @@ private:
bool isNewWallet() const;
bool doInit(const std::string &daemon_address, uint64_t upper_transaction_size_limit);
-
private:
friend class PendingTransactionImpl;
friend class UnsignedTransactionImpl;
diff --git a/src/wallet/wallet2_api.h b/src/wallet/wallet2_api.h
index 563f16eaa..883da7da2 100644
--- a/src/wallet/wallet2_api.h
+++ b/src/wallet/wallet2_api.h
@@ -332,26 +332,16 @@ struct Wallet
*/
virtual std::string keysFilename() const = 0;
/*!
- * \brief init - initializes wallet with daemon connection params. implicitly connects to the daemon
- * and refreshes the wallet. "refreshed" callback will be invoked. if daemon_address is
- * local address, "trusted daemon" will be set to true forcibly
+ * \brief init - initializes wallet with daemon connection params.
+ * if daemon_address is local address, "trusted daemon" will be set to true forcibly
+ * startRefresh() should be called when wallet is initialized.
*
* \param daemon_address - daemon address in "hostname:port" format
* \param upper_transaction_size_limit
- * \return - true if initialized and refreshed successfully
+ * \return - true on success
*/
virtual bool init(const std::string &daemon_address, uint64_t upper_transaction_size_limit) = 0;
- /*!
- * \brief init - initalizes wallet asynchronously. logic is the same as "init" but returns immediately.
- * "refreshed" callback will be invoked.
- *
- * \param daemon_address - daemon address in "hostname:port" format
- * \param upper_transaction_size_limit
- * \return - true if initialized and refreshed successfully
- */
- virtual void initAsync(const std::string &daemon_address, uint64_t upper_transaction_size_limit) = 0;
-
/*!
* \brief createWatchOnly - Creates a watch only wallet
* \param path - where to store the wallet