Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cardano-db-sync/src/Cardano/DbSync/Plugin/Epoch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -196,5 +196,5 @@ updateChainTipEpochVar _trce = do
atomicWriteIORef latestChainTipEpochVar 0
Right meta -> do
let epoch = diffUTCTime currentTime (DB.metaStartTime meta)
/ (0.01 * fromIntegral (DB.metaSlotDuration meta * DB.metaProtocolConst meta))
/ (0.001 * fromIntegral (DB.metaSlotDuration meta * DB.metaSlotsPerEpoch meta))
atomicWriteIORef latestChainTipEpochVar $ floor epoch
4 changes: 2 additions & 2 deletions cardano-db/src/Cardano/Db/Query.hs
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,8 @@ entityPair e =
epochUtcStartTime :: Meta -> Word64 -> UTCTime
epochUtcStartTime meta epochNum =
-- Slot duration is in milliseconds.
addUTCTime (21.6 * fromIntegral (epochNum * metaSlotDuration meta)) (metaStartTime meta)

addUTCTime (0.001 * fromIntegral (metaSlotsPerEpoch meta * epochNum * metaSlotDuration meta))
(metaStartTime meta)

epochUtcEndTime :: Meta -> Word64 -> UTCTime
epochUtcEndTime meta epochNum =
Expand Down