timedata: minor.
This commit is contained in:
parent
bd56c75d0d
commit
a11a1ab4ad
@ -7,8 +7,8 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
const util = require('../utils/util');
|
||||
const EventEmitter = require('events');
|
||||
const util = require('../utils/util');
|
||||
|
||||
/**
|
||||
* An object which handles "adjusted time". This may not
|
||||
@ -37,7 +37,7 @@ function TimeData(limit) {
|
||||
this.known = new Map();
|
||||
this.limit = limit;
|
||||
this.offset = 0;
|
||||
this._checked = false;
|
||||
this.checked = false;
|
||||
}
|
||||
|
||||
util.inherits(TimeData, EventEmitter);
|
||||
@ -70,7 +70,7 @@ TimeData.prototype.add = function add(id, time) {
|
||||
this.offset = median;
|
||||
} else {
|
||||
this.offset = 0;
|
||||
if (!this._checked) {
|
||||
if (!this.checked) {
|
||||
let match = false;
|
||||
for (let offset of this.samples) {
|
||||
if (offset !== 0 && Math.abs(offset) < 5 * 60) {
|
||||
@ -79,7 +79,7 @@ TimeData.prototype.add = function add(id, time) {
|
||||
}
|
||||
}
|
||||
if (!match) {
|
||||
this._checked = true;
|
||||
this.checked = true;
|
||||
this.emit('mismatch');
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user