Skip to content
This repository has been archived by the owner on Sep 5, 2020. It is now read-only.

Mac OSX High Sierra fix + Skips timesync check flag #3146

Merged
merged 2 commits into from
Oct 11, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 18 additions & 19 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion modules/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:',
Expand All @@ -141,7 +149,6 @@ const argv = require('yargs')
.alias('h', 'help')
.parse(process.argv.slice(1));


argv.nodeOptions = [];

for (const optIdx in argv) {
Expand Down Expand Up @@ -304,6 +311,10 @@ class Settings {
this.saveConfig('ui.i18n', langCode);
}

get skiptimesynccheck() {
return argv.skiptimesynccheck;
}

initConfig() {
global.config.insert({
ui: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down