| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Ouroboros.Consensus.BlockchainTime.WallClock.Simple
Synopsis
- simpleBlockchainTime :: forall m. IOLike m => ResourceRegistry m -> SystemTime m -> SlotLength -> m (BlockchainTime m)
- getWallClockSlot :: IOLike m => SystemTime m -> SlotLength -> m (SlotNo, NominalDiffTime)
- waitUntilNextSlot :: IOLike m => SystemTime m -> SlotLength -> SlotNo -> m SlotNo
Documentation
simpleBlockchainTime :: forall m. IOLike m => ResourceRegistry m -> SystemTime m -> SlotLength -> m (BlockchainTime m) Source #
Real blockchain time
WARNING: if the start time is in the future, simpleBlockchainTime will
block until the start time has come.
Low-level API (exported primarily for testing)
getWallClockSlot :: IOLike m => SystemTime m -> SlotLength -> m (SlotNo, NominalDiffTime) Source #
Get current slot and time spent in that slot
Arguments
| :: IOLike m | |
| => SystemTime m | |
| -> SlotLength | |
| -> SlotNo | Current slot number |
| -> m SlotNo |
Wait until the next slot
Takes the current slot number to guard against system clock changes. Any
clock changes that would result in the slot number to decrease will result
in a fatal SystemClockMovedBackException. When this exception is thrown,
the node will shut down, and should be restarted with (full?) validation
enabled: it is conceivable that blocks got moved to the immutable DB that,
due to the clock change, should not be considered immutable anymore.