Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Merge pull request #3500 from input-output-hk/topic/fix-bad-github-merge
Browse files Browse the repository at this point in the history
Fix bad Github merge
  • Loading branch information
CodiePP authored Aug 29, 2018
2 parents cba2b8f + 0092424 commit 7944c1b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions db/src/Pos/DB/Block/Epoch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import System.IO.Error (isDoesNotExistError)

import Pos.Binary.Class (Cons (..), Field (..), deriveSimpleBi)
import Pos.Chain.Block (HeaderHash, blockHeaderHash)
import Pos.Core (EpochIndex (..), EpochOrSlot (..),
LocalSlotIndex (..), SlotId (..), epochSlots,
getEpochOrSlot)
import Pos.Core as Core (Config (..), EpochIndex (..),
EpochOrSlot (..), LocalSlotIndex (..), SlotCount (..),
SlotId (..), configEpochSlots, getEpochOrSlot)
import Pos.DB.Block.GState.BlockExtra (getFirstGenesisBlockHash,
resolveForwardLink)
import Pos.DB.Block.Internal (bspBlund, dbGetSerBlockRealFile,
Expand Down Expand Up @@ -92,15 +92,15 @@ renderConsolidateError = \case
-- is running at any time.
consoldidateEpochs
:: (MonadCatch m, MonadDB m, MonadIO m, MonadMask m, MonadReader NodeDBs m)
=> ExceptT ConsolidateError m ()
consoldidateEpochs = ExceptT $ do
=> Core.Config -> ExceptT ConsolidateError m ()
consoldidateEpochs coreConfig = ExceptT $ do
elock <- view epochLock <$> getNodeDBs
mr <- whenAcquireWrite elock $ do
tipEpoch <- getTipEpoch
checkPoint <- getConsolidateCheckPoint
if tipEpoch < 2
then pure $ Right ()
else consolidateLoop checkPoint (tipEpoch - 1)
else consolidateLoop checkPoint (configEpochSlots coreConfig) (tipEpoch - 1)
pure $ fromMaybe (Right ()) mr


Expand Down Expand Up @@ -210,8 +210,8 @@ type ConsolidateM m =
-- On each loop, the check point in the 'MiscDB' is updated.
consolidateLoop
:: ConsolidateM m
=> ConsolidateCheckPoint -> EpochIndex -> m (Either ConsolidateError ())
consolidateLoop startCcp endEpoch
=> ConsolidateCheckPoint -> SlotCount -> EpochIndex -> m (Either ConsolidateError ())
consolidateLoop startCcp epochSlots endEpoch
| ccpEpochIndex startCcp >= endEpoch = pure $ Right ()
| otherwise = runExceptT $ loop startCcp
where
Expand Down

0 comments on commit 7944c1b

Please sign in to comment.