From fd446f3212f0915e22d8424829c440a6d146881e Mon Sep 17 00:00:00 2001 From: tima-t Date: Fri, 23 Apr 2021 10:15:59 +0300 Subject: [PATCH] amended getting of current block in subscribe and polling on 20 seconds --- src/blockchain/xinfin/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blockchain/xinfin/index.ts b/src/blockchain/xinfin/index.ts index 9c0fdbe..5aa647a 100644 --- a/src/blockchain/xinfin/index.ts +++ b/src/blockchain/xinfin/index.ts @@ -9,7 +9,7 @@ import Withdraw from '../../components/withdraw/entity'; import Refund from '../../components/refund/entity'; import Emitter from '../../websocket/emitter'; -const SYNC_PERIOD = 10000; //10 seconds +const SYNC_PERIOD = 20000; //20 seconds export default class XinfinEvent { public readonly syncBlocksMargin = Config.syncBlocksMargin; @@ -29,6 +29,7 @@ export default class XinfinEvent { } async subscribe() { + this.lastScanned = await this.getBlock(); setInterval(async () => { const latestBlock = await this.getBlock(); await this.getPast(this.lastScanned);