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

Commit

Permalink
Fix bad Github merge
Browse files Browse the repository at this point in the history
The changes in PRs #3491 and #3482 turned out to be incompatible.
To avoind things like this, it would be ideal if PRs were not
merged unless they were rebased and had a complete CI build first.
  • Loading branch information
erikd committed Aug 29, 2018
1 parent f4d550d commit 0092424
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 0092424

Please sign in to comment.