From 16d64aa9735e4de37799a8b3e5372db8d9d6570c Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 18 Aug 2022 14:54:40 +0200 Subject: [PATCH] start logging as soon as possible --- libs/remix-lib/src/execution/txListener.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/remix-lib/src/execution/txListener.ts b/libs/remix-lib/src/execution/txListener.ts index 17f5a8f2b8..808d9fe4e0 100644 --- a/libs/remix-lib/src/execution/txListener.ts +++ b/libs/remix-lib/src/execution/txListener.ts @@ -159,10 +159,11 @@ export class TxListener { } async _startListenOnNetwork () { - let lastSeenBlock = this.executionContext.lastBlock?.number + let lastSeenBlock = this.executionContext.lastBlock?.number - 1 let processingBlock = false const processBlocks = async () => { + if (!this._isListening) return if (processingBlock) return processingBlock = true const currentLoopId = this._loopId @@ -196,8 +197,8 @@ export class TxListener { } processingBlock = false } - processBlocks() this._loopId = setInterval(processBlocks, 20000) + processBlocks() } async _manageBlock (blockNumber) {