Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxySciTech committed Sep 12, 2023
1 parent abaa70f commit 7184c89
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions backend/src/services/block.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7184c89

Please sign in to comment.