From 4527e0d96cf97d4776dd61d1f8ab9c5414508c55 Mon Sep 17 00:00:00 2001 From: Dmitry Zuikov Date: Wed, 29 Mar 2023 16:43:47 +0300 Subject: [PATCH] typos --- hbs2-peer/app/BlockDownload.hs | 2 +- hbs2-peer/app/Brains.hs | 8 ++++---- hbs2-peer/app/PeerTypes.hs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/hbs2-peer/app/BlockDownload.hs b/hbs2-peer/app/BlockDownload.hs index 28a18b25..11996f2d 100644 --- a/hbs2-peer/app/BlockDownload.hs +++ b/hbs2-peer/app/BlockDownload.hs @@ -523,7 +523,7 @@ blockDownloadLoop env0 = do liftIO $ atomically $ writeTVar tinfo alive - po <- postoponedNum + po <- postponedNum wipNum <- liftIO $ Cache.size wip diff --git a/hbs2-peer/app/Brains.hs b/hbs2-peer/app/Brains.hs index 7fb43b76..f6d19b9b 100644 --- a/hbs2-peer/app/Brains.hs +++ b/hbs2-peer/app/Brains.hs @@ -41,7 +41,7 @@ class HasBrains e a where -> Hash HbSync -> m () - shouldPosponeBlock :: MonadIO m + shouldPostponeBlock :: MonadIO m => a -> Hash HbSync -> m Bool @@ -70,7 +70,7 @@ instance Pretty (Peer e) => HasBrains e NoBrains where claimBlockCameFrom _ _ _ = do pure () - shouldPosponeBlock _ _ = pure False + shouldPostponeBlock _ _ = pure False shouldDownloadBlock _ _ _ = pure True @@ -82,7 +82,7 @@ instance HasBrains e (SomeBrains e) where onBlockDownloaded (SomeBrains a) = onBlockDownloaded a onBlockPostponed (SomeBrains a) = onBlockPostponed @e a claimBlockCameFrom (SomeBrains a) = claimBlockCameFrom @e a - shouldPosponeBlock (SomeBrains a) = shouldPosponeBlock @e a + shouldPostponeBlock (SomeBrains a) = shouldPostponeBlock @e a shouldDownloadBlock (SomeBrains a) = shouldDownloadBlock @e a data BasicBrains e = @@ -123,7 +123,7 @@ instance Hashable (Peer e) => HasBrains e (BasicBrains e) where claimBlockCameFrom _ _ _ = do trace "BRAINS: claimBlockCameFrom" - shouldPosponeBlock b h = do + shouldPostponeBlock b h = do peers <- liftIO $ readTVarIO (view brainsPeers b) downs <- liftIO $ readTVarIO (view brainsPostponeDown b) diff --git a/hbs2-peer/app/PeerTypes.hs b/hbs2-peer/app/PeerTypes.hs index a1db09c8..aba347fb 100644 --- a/hbs2-peer/app/PeerTypes.hs +++ b/hbs2-peer/app/PeerTypes.hs @@ -286,7 +286,7 @@ addDownload mbh h = do maybe1 mbh none $ \hp -> claimBlockCameFrom @e brains hp h - postpone <- shouldPosponeBlock @e brains h + postpone <- shouldPostponeBlock @e brains h when postpone do -- trace $ "addDownload postpone" <+> pretty postpone <+> pretty h @@ -314,8 +314,8 @@ addDownload mbh h = do Cache.insert wip h () -postoponedNum :: forall e m . (MyPeer e, MonadIO m) => BlockDownloadM e m Int -postoponedNum = do +postponedNum :: forall e m . (MyPeer e, MonadIO m) => BlockDownloadM e m Int +postponedNum = do po <- asks (view blockPostponed) liftIO $ readTVarIO po <&> HashMap.size