From 7184c89f558f4c70a3786eca55dedc275af94344 Mon Sep 17 00:00:00 2001 From: Galaxy <429224280@qq.com> Date: Tue, 12 Sep 2023 19:55:57 +0200 Subject: [PATCH] update --- backend/src/services/block.service.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/backend/src/services/block.service.ts b/backend/src/services/block.service.ts index 73d790c..5b7e6b6 100644 --- a/backend/src/services/block.service.ts +++ b/backend/src/services/block.service.ts @@ -211,13 +211,10 @@ export class BlockService { const { smartContractHeight, smartContractCommittedHash } = await this.getAndSetLastSubmittedBlockInfo(); const mode = await this.parentChainClient.mode(); const { timestamp } = await this.parentChainClient.getParentChainBlockBySubnetHash(smartContractCommittedHash); - let isProcessing = true; + const timeDiff = new Date().getTime() / 1000 - parseInt(timestamp.toString()); - if (mode == 'lite') { - if (timeDiff > 1000) isProcessing = false; - } else if (mode == 'full') { - if (timeDiff > 120) isProcessing = false; - } + + const isProcessing = (mode == 'full' && timeDiff < 120) || (mode == 'lite' && timeDiff < 1000); return { processedUntil: smartContractHeight,