diff options
author | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-02-17 13:15:21 +0000 |
---|---|---|
committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2020-02-17 13:16:09 +0000 |
commit | 927fd4793439aa6d216167b8a085b60d58ee6f5a (patch) | |
tree | dcdc63cb2902652096f11db6ce9aec666f2d0432 | |
parent | Merge pull request #6048 (diff) | |
download | monero-927fd4793439aa6d216167b8a085b60d58ee6f5a.tar.xz |
simplewallet: fix smart mining not starting after first setup
Also avoid rewriting the wallet if the setting is already was we need
-rw-r--r-- | src/simplewallet/simplewallet.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 74e793669..77da65c7d 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -5199,8 +5199,11 @@ void simple_wallet::check_background_mining(const epee::wipeable_string &passwor if (is_background_mining_enabled) { // already active, nice - m_wallet->setup_background_mining(tools::wallet2::BackgroundMiningYes); - m_wallet->rewrite(m_wallet_file, password); + if (setup == tools::wallet2::BackgroundMiningMaybe) + { + m_wallet->setup_background_mining(tools::wallet2::BackgroundMiningYes); + m_wallet->rewrite(m_wallet_file, password); + } start_background_mining(); return; } @@ -5223,6 +5226,11 @@ void simple_wallet::check_background_mining(const epee::wipeable_string &passwor m_wallet->rewrite(m_wallet_file, password); start_background_mining(); } + else + { + // the setting is already enabled, and the daemon is not mining yet, so start it + start_background_mining(); + } } //---------------------------------------------------------------------------------------------------- bool simple_wallet::start_mining(const std::vector<std::string>& args) |