From a46b8eb5299af00d2f4ecb5edd2784031b4db727 Mon Sep 17 00:00:00 2001 From: Everton Fraga Date: Fri, 6 Oct 2017 15:00:58 -0300 Subject: [PATCH 1/2] Updating os-timesync package --- package.json | 2 +- yarn.lock | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 93406aa0c..0cc4b2f7f 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "minimongo-standalone": "^1.1.0-3", "numeral": "^2.0.6", "oboe": "^2.1.3", - "os-timesync": "^1.0.7", + "os-timesync": "^1.0.8", "semver": "^5.1.0", "solc": "^0.4.15", "swarm-js": "^0.1.21", diff --git a/yarn.lock b/yarn.lock index 8c49e7ce9..20488853a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3814,9 +3814,9 @@ os-locale@^1.4.0: dependencies: lcid "^1.0.0" -os-timesync@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/os-timesync/-/os-timesync-1.0.7.tgz#fc7ea7e6de1fc88742880cd08ff284327678e20d" +os-timesync@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/os-timesync/-/os-timesync-1.0.8.tgz#390ae8832e20183ea3fc1b97ea90bcbc97c0178f" os-tmpdir@^1.0.0, os-tmpdir@^1.0.1, os-tmpdir@~1.0.1: version "1.0.2" From 345473757c2b3550ed3a74480b56c36e6ea90113 Mon Sep 17 00:00:00 2001 From: Everton Fraga Date: Mon, 9 Oct 2017 10:47:35 -0300 Subject: [PATCH 2/2] Enables to skip tine syncing check --- main.js | 37 ++++++++++++++++++------------------- modules/settings.js | 13 ++++++++++++- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/main.js b/main.js index 095c952c0..9e57d70f2 100644 --- a/main.js +++ b/main.js @@ -270,26 +270,25 @@ onReady = () => { }); } - // check time sync - // var ntpClient = require('ntp-client'); - // ntpClient.getNetworkTime("pool.ntp.org", 123, function(err, date) { - timesync.checkEnabled((err, enabled) => { - if (err) { - log.error('Couldn\'t get time from NTP time sync server.', err); - return; - } - - if (!enabled) { - dialog.showMessageBox({ - type: 'warning', - buttons: ['OK'], - message: global.i18n.t('mist.errors.timeSync.title'), - detail: `${global.i18n.t('mist.errors.timeSync.description')}\n\n${global.i18n.t(`mist.errors.timeSync.${process.platform}`)}`, - }, () => { - }); - } - }); + // Checks time sync + if (!Settings.skiptimesynccheck) { + timesync.checkEnabled((err, enabled) => { + if (err) { + log.error('Couldn\'t infer if computer automatically syncs time.', err); + return; + } + if (!enabled) { + dialog.showMessageBox({ + type: 'warning', + buttons: ['OK'], + message: global.i18n.t('mist.errors.timeSync.title'), + detail: `${global.i18n.t('mist.errors.timeSync.description')}\n\n${global.i18n.t(`mist.errors.timeSync.${process.platform}`)}`, + }, () => { + }); + } + }); + } const kickStart = () => { // client binary stuff diff --git a/modules/settings.js b/modules/settings.js index b09f77afa..87beeae3c 100644 --- a/modules/settings.js +++ b/modules/settings.js @@ -132,6 +132,14 @@ const argv = require('yargs') group: 'Mist options:', type: 'boolean', }, + skiptimesynccheck: { + demand: false, + requiresArg: false, + nargs: 0, + describe: 'Disable checks for the presence of automatic time sync on your OS.', + group: 'Mist options:', + type: 'boolean', + }, '': { describe: 'To pass options to the underlying node (e.g. Geth) use the --node- prefix, e.g. --node-datadir', group: 'Node options:', @@ -141,7 +149,6 @@ const argv = require('yargs') .alias('h', 'help') .parse(process.argv.slice(1)); - argv.nodeOptions = []; for (const optIdx in argv) { @@ -304,6 +311,10 @@ class Settings { this.saveConfig('ui.i18n', langCode); } + get skiptimesynccheck() { + return argv.skiptimesynccheck; + } + initConfig() { global.config.insert({ ui: {