From e173408132791c1dee2887cb42ee9691c8df0a9e Mon Sep 17 00:00:00 2001 From: doomsower <12031673+doomsower@users.noreply.github.com> Date: Mon, 22 Jul 2024 14:40:04 -0500 Subject: [PATCH] fix: from now ts calculation --- src/services/RedstoneServiceV3.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/services/RedstoneServiceV3.ts b/src/services/RedstoneServiceV3.ts index 31b8c45..91898ca 100644 --- a/src/services/RedstoneServiceV3.ts +++ b/src/services/RedstoneServiceV3.ts @@ -85,7 +85,7 @@ export class RedstoneServiceV3 { // and scripts can take dozens of blocks (hundreds for faucet). So we take min value; const now = new Date().getTime(); const anvilTs = 10 * Math.floor(Number(block.timestamp) / 10) * 1000; - const fromNowTs = 10_000 * Math.floor(now / 10_000 - 10_000); + const fromNowTs = 10_000 * Math.floor(now / 10_000 - 1); this.#optimisticTimestamp = Math.min(anvilTs, fromNowTs); const delta = Math.floor(now / 1000) - this.#optimisticTimestamp; this.logger.info(