Skip to content

Commit

Permalink
amended getting of current block in subscribe and polling on 20 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
tima-t committed Apr 23, 2021
1 parent 96aba0a commit fd446f3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/blockchain/xinfin/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit fd446f3

Please sign in to comment.