ouroboros-consensus-0.1.0.0: Consensus layer for the Ouroboros blockchain protocol
Safe HaskellNone
LanguageHaskell2010

Ouroboros.Consensus.Storage.ChainDB.Impl.Reader

Description

Readers

Synopsis

Documentation

newReader :: forall m blk b. (IOLike m, HasHeader blk, GetHeader blk, HasNestedContent Header blk, EncodeDiskDep (NestedCtxt Header) blk) => ChainDbHandle m blk -> ResourceRegistry m -> BlockComponent blk b -> m (Reader m blk b) Source #

switchFork Source #

Arguments

:: forall m blk b. (HasHeader blk, HasHeader (Header blk)) 
=> Point blk

Intersection point between old and new chain

-> AnchoredFragment (Header blk)

The new chain

-> ReaderState m blk b 
-> ReaderState m blk b 

Update the given ReaderState to account for switching the current chain to the given fork (which might just be an extension of the current chain).

PRECONDITION: the intersection point must be within the fragment bounds of the new chain

closeAllReaders :: IOLike m => ChainDbEnv m blk -> m () Source #

Close all open block and header Readers.