@@ -72,19 +72,19 @@ module Haskoin.Block.Headers (
72
72
import Control.Applicative ((<|>) )
73
73
import Control.DeepSeq
74
74
import Control.Monad (guard , mzero , unless , when )
75
- import Control.Monad.Except (
75
+ import Control.Monad.Trans.Class (lift )
76
+ import Control.Monad.Trans.Except (
76
77
ExceptT (.. ),
77
78
runExceptT ,
78
- throwError ,
79
+ throwE ,
79
80
)
80
- import Control.Monad.State.Strict as State (
81
+ import Control.Monad.Trans.Maybe
82
+ import Control.Monad.Trans.State.Strict as State (
81
83
StateT ,
82
84
get ,
83
85
gets ,
84
- lift ,
85
86
modify ,
86
87
)
87
- import Control.Monad.Trans.Maybe
88
88
import Data.Binary (Binary (.. ))
89
89
import Data.Bits (shiftL , shiftR , (.&.) )
90
90
import qualified Data.ByteString as B
@@ -332,7 +332,7 @@ connectBlocks _ _ [] = return $ Right []
332
332
connectBlocks net t bhs@ (bh : _) =
333
333
runExceptT $ do
334
334
unless (chained bhs) $
335
- throwError " Blocks to connect do not form a chain"
335
+ throwE " Blocks to connect do not form a chain"
336
336
par <-
337
337
maybeToExceptT
338
338
" Could not get parent block"
@@ -356,13 +356,13 @@ connectBlocks net t bhs@(bh : _) =
356
356
case skM of
357
357
Just sk -> return sk
358
358
Nothing ->
359
- throwError $
359
+ throwE $
360
360
" BUG: Could not get skip for block "
361
361
++ show (headerHash $ nodeHeader par)
362
362
| otherwise = do
363
363
let sn = ls !! fromIntegral (nodeHeight par - sh)
364
364
when (nodeHeight sn /= sh) $
365
- throwError " BUG: Node height not right in skip"
365
+ throwE " BUG: Node height not right in skip"
366
366
return sn
367
367
where
368
368
sh = skipHeight (nodeHeight par + 1 )
@@ -403,7 +403,7 @@ connectBlock net t bh =
403
403
case skM of
404
404
Just sk -> return sk
405
405
Nothing ->
406
- throwError $
406
+ throwE $
407
407
" BUG: Could not get skip for block "
408
408
++ show (headerHash $ nodeHeader par)
409
409
bb <- lift getBestBlockHeader
0 commit comments