Fix time synchronization with server

- avoid that client time being ahead of server time
This commit is contained in:
Stefan Aebischer
2020-01-15 14:38:23 -05:00
parent 90cd20526f
commit e5fd04afc1

View File

@@ -43,7 +43,7 @@ module.exports = class Request {
const result = await this.get('/v2/public/time'); const result = await this.get('/v2/public/time');
const end = Date.now(); const end = Date.now();
return Math.ceil((result.time_now * 1000) - start + ((end - start) / 2)); return Math.ceil((result.time_now * 1000) - end + ((end - start) / 2));
} }
async _call(method, endpoint, params) { async _call(method, endpoint, params) {