aboutsummaryrefslogtreecommitdiff
path: root/src/daemon/DaemonManager.cpp
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-09-14 12:41:02 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-09-14 12:41:02 -0500
commit3cf2dc0c04e763aef0b71ba1a330849968ebe3a9 (patch)
tree353d9c588cc280c869d2cb07feabd3422e540431 /src/daemon/DaemonManager.cpp
parenta5b2d5e727c44d03c5f3f96d9726658caa9cdb6d (diff)
parent0d247a9b8a2fa6770d1834584eedb109c6ab7e3d (diff)
downloadmonzero-gui-3cf2dc0c04e763aef0b71ba1a330849968ebe3a9.tar.gz
monzero-gui-3cf2dc0c04e763aef0b71ba1a330849968ebe3a9.tar.xz
monzero-gui-3cf2dc0c04e763aef0b71ba1a330849968ebe3a9.zip
Merge pull request #2370
0d247a9 SimpleMode: automatic public nodes discovering and switching (xiphon)
Diffstat (limited to 'src/daemon/DaemonManager.cpp')
-rw-r--r--src/daemon/DaemonManager.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/daemon/DaemonManager.cpp b/src/daemon/DaemonManager.cpp
index 4277e0bb..29a7086d 100644
--- a/src/daemon/DaemonManager.cpp
+++ b/src/daemon/DaemonManager.cpp
@@ -61,7 +61,7 @@ DaemonManager *DaemonManager::instance(const QStringList *args)
return m_instance;
}
-bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const QString &dataDir, const QString &bootstrapNodeAddress)
+bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const QString &dataDir, const QString &bootstrapNodeAddress, bool noSync /* = false*/)
{
// prepare command line arguments and pass to monerod
QStringList arguments;
@@ -99,6 +99,10 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const
arguments << "--bootstrap-daemon-address" << bootstrapNodeAddress;
}
+ if (noSync) {
+ arguments << "--no-sync";
+ }
+
arguments << "--check-updates" << "disabled";
// --max-concurrency based on threads available. max: 6
@@ -131,11 +135,13 @@ bool DaemonManager::start(const QString &flags, NetworkType::Type nettype, const
}
// Start start watcher
- m_scheduler.run([this, nettype] {
- if (startWatcher(nettype))
+ m_scheduler.run([this, nettype, noSync] {
+ if (startWatcher(nettype)) {
emit daemonStarted();
- else
+ m_noSync = noSync;
+ } else {
emit daemonStartFailure();
+ }
});
return true;
@@ -244,6 +250,11 @@ bool DaemonManager::running(NetworkType::Type nettype) const
return false;
}
+bool DaemonManager::noSync() const noexcept
+{
+ return m_noSync;
+}
+
void DaemonManager::runningAsync(NetworkType::Type nettype, const QJSValue& callback) const
{
m_scheduler.run([this, nettype] {