From aadd3418f9341fb3c2b0726617c1cd817e93792b Mon Sep 17 00:00:00 2001 From: Kirill Fedoseev Date: Mon, 7 Oct 2019 16:49:20 +0300 Subject: [PATCH] Fixed initial foreign time --- src/oracle/bncWatcher/bncWatcher.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oracle/bncWatcher/bncWatcher.js b/src/oracle/bncWatcher/bncWatcher.js index e103a10..fcb4eb4 100644 --- a/src/oracle/bncWatcher/bncWatcher.js +++ b/src/oracle/bncWatcher/bncWatcher.js @@ -16,7 +16,7 @@ const proxyHttpClient = axios.create({ baseURL: PROXY_URL }) async function initialize () { if (await redis.get('foreignTime') === null) { logger.info('Set default foreign time') - await redis.set('foreignTime', 1562306990672) + await redis.set('foreignTime', Date.now() - 2 * 30 * 24 * 60 * 60 * 1000) } } @@ -61,7 +61,7 @@ function getTx(hash) { async function fetchNewTransactions () { logger.debug('Fetching new transactions') const startTime = parseInt(await redis.get('foreignTime')) + 1 - const address = await getLastForeignAddress() + const address = getLastForeignAddress() if (address === null) return null logger.debug('Sending api transactions request')