Skip to content
Permalink
Browse files

[DDW-684] Better namings

  • Loading branch information...
daniloprates committed Jul 11, 2019
1 parent 615fb1b commit a6cf20497b64ee68cccccfb352ca637d3f76651b
@@ -12,4 +12,4 @@ export const SIMPLE_DECIMAL_PLACES_IN_ADA = 2;
export const UNSYNCED_BLOCKS_ALLOWED = 6;
export const TX_UNCONFIRMED_THRESHOLD = 6;
export const TX_AGE_POLLING_THRESHOLD = 15 * 60 * 1000; // 15 minutes | unit: milliseconds
export const NTP_CHECKS_BEFORE_ERROR_OVERLAY = 3;
export const MAX_NTP_TOLERATION_CHECKS = 3;
@@ -15,7 +15,7 @@ export const MAX_ALLOWED_STALL_DURATION = isTest ? 15000 : 2 * 60 * 1000; // 2 m
export const NETWORK_STATUS_REQUEST_TIMEOUT = 30 * 1000; // 30 seconds | unit: milliseconds
export const NETWORK_STATUS_POLL_INTERVAL = 2000; // 2 seconds | unit: milliseconds
export const NTP_IGNORE_CHECKS_GRACE_PERIOD = isTest ? 500 : 35 * 1000; // 35 seconds | unit: milliseconds
export const NTP_CHECKS_BEFORE_ERROR_OVERLAY_INTERVAL = 1 * 1000; // 1 second | unit: milliseconds;
export const NTP_TOLERATION_CHECKS_INTERVAL = 1 * 1000; // 1 second | unit: milliseconds;
export const BLOCK_CONSOLIDATION_IPC_REQUEST_INTERVAL = 10 * 1000; // 10 seconds | unit: milliseconds
export const BLOCK_CONSOLIDATION_API_REQUEST_INTERVAL = 30 * 1000; // 30 seconds | unit: milliseconds
export const WALLET_UTXO_API_REQUEST_INTERVAL = 5 * 1000; // 5 seconds | unit: milliseconds
@@ -10,11 +10,11 @@ import {
NETWORK_STATUS_REQUEST_TIMEOUT,
NETWORK_STATUS_POLL_INTERVAL,
NTP_IGNORE_CHECKS_GRACE_PERIOD,
NTP_CHECKS_BEFORE_ERROR_OVERLAY_INTERVAL,
NTP_TOLERATION_CHECKS_INTERVAL,
} from '../config/timingConfig';
import {
UNSYNCED_BLOCKS_ALLOWED,
NTP_CHECKS_BEFORE_ERROR_OVERLAY,
MAX_NTP_TOLERATION_CHECKS,
} from '../config/numbersConfig';
import { Logger } from '../utils/logging';
import {
@@ -82,7 +82,7 @@ export default class NetworkStatusStore extends Store {

// NTP
@observable isNodeTimeCorrect = true; // Is 'true' in case local and global time are in sync
@observable numberOfNTPChecks = 0; // Is 'true' in case local and global time are in sync
@observable numberOfNTPTolerationChecks = 0; // Is 'true' in case local and global time are in sync

@observable hasBeenConnected = false;
@observable syncProgress = null;
@@ -407,15 +407,15 @@ export default class NetworkStatusStore extends Store {
if (
!isNodeTimeCorrect &&
this.isNodeTimeCorrect &&
this.numberOfNTPChecks < NTP_CHECKS_BEFORE_ERROR_OVERLAY
this.numberOfNTPTolerationChecks < MAX_NTP_TOLERATION_CHECKS
) {
this.numberOfNTPChecks++;
this.numberOfNTPTolerationChecks++;
setTimeout(
this.forceCheckLocalTimeDifference,
NTP_CHECKS_BEFORE_ERROR_OVERLAY_INTERVAL
NTP_TOLERATION_CHECKS_INTERVAL
);
} else {
this.numberOfNTPChecks = 0;
this.numberOfNTPTolerationChecks = 0;
this.isNodeTimeCorrect = isNodeTimeCorrect;
}
}

0 comments on commit a6cf204

Please sign in to comment.
You can’t perform that action at this time.