Skip to content

Commit

Permalink
fix: from now ts calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
doomsower committed Jul 22, 2024
1 parent 08766c0 commit e173408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/services/RedstoneServiceV3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit e173408

Please sign in to comment.