From e5fd04afc19b2acdea111bc9f8e11e67ea209cbc Mon Sep 17 00:00:00 2001 From: Stefan Aebischer Date: Wed, 15 Jan 2020 14:38:23 -0500 Subject: [PATCH] Fix time synchronization with server - avoid that client time being ahead of server time --- lib/request.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/request.js b/lib/request.js index e609a20..7cfbfe3 100644 --- a/lib/request.js +++ b/lib/request.js @@ -43,7 +43,7 @@ module.exports = class Request { const result = await this.get('/v2/public/time'); 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) {