aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2020-04-10 15:59:14 -0500
committerluigi1111 <luigi1111w@gmail.com>2020-04-10 15:59:14 -0500
commit53800b3b63258a0f0bb7c4513dbd809b289f6f79 (patch)
tree3ad9f647ee13c741d7c6518a94637b2ceef80752
parentecb8cc9df40e466573df1c1956e374f17c960b8e (diff)
parent927fd4793439aa6d216167b8a085b60d58ee6f5a (diff)
downloadmonzero-core-53800b3b63258a0f0bb7c4513dbd809b289f6f79.tar.gz
monzero-core-53800b3b63258a0f0bb7c4513dbd809b289f6f79.tar.xz
monzero-core-53800b3b63258a0f0bb7c4513dbd809b289f6f79.zip
Merge pull request #6341
927fd47 simplewallet: fix smart mining not starting after first setup (moneromooo-monero)
-rw-r--r--src/simplewallet/simplewallet.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp
index 5efa54a19..a6844ba0a 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)