mirror of https://github.com/voidlizard/hbs2
qblf update
This commit is contained in:
parent
475db5ae30
commit
be183a9d40
|
@ -4,6 +4,7 @@ import HBS2.Prelude.Plated
|
|||
import HBS2.Hash
|
||||
import HBS2.Data.Types
|
||||
import HBS2.Merkle
|
||||
import HBS2.Merkle.Walk
|
||||
import HBS2.Storage
|
||||
|
||||
-- import HBS2.System.Logger.Simple
|
||||
|
@ -22,6 +23,7 @@ import Control.Concurrent.STM
|
|||
import Data.HashMap.Strict qualified as HashMap
|
||||
-- import Data.HashMap.Strict (HashMap)
|
||||
import Data.List qualified as List
|
||||
import UnliftIO qualified
|
||||
|
||||
import Streaming.Prelude qualified as S
|
||||
-- import Streaming qualified as S
|
||||
|
@ -159,6 +161,15 @@ readLog getBlk (HashRef h) =
|
|||
Left{} -> pure ()
|
||||
Right (hrr :: [HashRef]) -> S.each hrr
|
||||
|
||||
readLogThrow :: forall m . ( MonadIO m )
|
||||
=> ( Hash HbSync -> IO (Maybe ByteString) )
|
||||
-> HashRef
|
||||
-> m [HashRef]
|
||||
readLogThrow getBlk (HashRef h) =
|
||||
S.toList_ do
|
||||
either UnliftIO.throwIO pure =<<
|
||||
streamMerkle (liftIO . getBlk) h
|
||||
|
||||
|
||||
-- FIXME: make-it-stop-after-first-missed-block
|
||||
checkComplete :: forall sto m . (MonadIO m, Storage sto HbSync ByteString IO)
|
||||
|
|
Loading…
Reference in New Issue