From c6ae47e2d1440fbc38d61e38c2d2a1d5843475d1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Smr=C5=BE?= <roman.smrz@seznam.cz>
Date: Sun, 30 Jun 2024 17:47:45 +0200
Subject: Network: use Monotonic instead of MonotonicRaw clock

---
 src/Erebos/Network/Protocol.hs | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'src/Erebos')

diff --git a/src/Erebos/Network/Protocol.hs b/src/Erebos/Network/Protocol.hs
index a009ad1..b0047fc 100644
--- a/src/Erebos/Network/Protocol.hs
+++ b/src/Erebos/Network/Protocol.hs
@@ -440,7 +440,7 @@ erebosNetworkProtocol initialIdentity gLog gDataFlow gControlFlow = do
     mStorage <- memoryStorage
     gStorage <- derivePartialStorage mStorage
 
-    startTime <- getTime MonotonicRaw
+    startTime <- getTime Monotonic
     gNowVar <- newTVarIO startTime
     gNextTimeout <- newTVarIO startTime
     gInitConfig <- store mStorage $ (Rec [] :: Object)
@@ -448,7 +448,7 @@ erebosNetworkProtocol initialIdentity gLog gDataFlow gControlFlow = do
     let gs = GlobalState {..}
 
     let signalTimeouts = forever $ do
-            now <- getTime MonotonicRaw
+            now <- getTime Monotonic
             next <- atomically $ do
                 writeTVar gNowVar now
                 readTVar gNextTimeout
@@ -715,7 +715,7 @@ reservePacket conn@Connection {..} = do
 resendBytes :: Connection addr -> Maybe ReservedToSend -> SentPacket -> IO ()
 resendBytes Connection {..} reserved sp = do
     let GlobalState {..} = cGlobalState
-    now <- getTime MonotonicRaw
+    now <- getTime Monotonic
     atomically $ do
         when (isJust reserved) $ do
             modifyTVar' cReservedPackets (subtract 1)
-- 
cgit v1.2.3