Skip to content

Commit

Permalink
fix: fix regression in getCurrentSlotAround
Browse files Browse the repository at this point in the history
  • Loading branch information
wemeetagain committed Feb 7, 2024
1 parent 3bc9673 commit 71d871a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/validator/src/util/clock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export class Clock implements IClock {
*/
export function getCurrentSlotAround(config: ChainForkConfig, genesisTime: TimeSeconds): Slot {
const diffInSeconds = Date.now() / 1000 - genesisTime;
const slotsSinceGenesis = Math.floor(diffInSeconds / config.SECONDS_PER_SLOT);
const slotsSinceGenesis = Math.round(diffInSeconds / config.SECONDS_PER_SLOT);
return GENESIS_SLOT + slotsSinceGenesis;
}

Expand Down

0 comments on commit 71d871a

Please sign in to comment.