Function forest_filecoin::ipld::util::stream_chain
source · pub fn stream_chain<DB: Blockstore, T: Iterator<Item = Tipset> + Unpin>(
db: DB,
tipset_iter: T,
stateroot_limit: i64,
) -> ChainStream<DB, T>
Expand description
Stream all blocks that are reachable before the stateroot_limit
epoch in a depth-first
fashion.
After this limit, only block headers are streamed. Any dead links are reported as errors.
§Arguments
db
- A database that implementsBlockstore
interface.tipset_iter
- An iterator ofTipset
, descending order$child -> $parent
.stateroot_limit
- An epoch that signifies how far back we need to inspect tipsets, in-depth. This has to be pre-calculated using this formula:$cur_epoch - $depth
, where$depth
is the number of[
Tipset]
that needs inspection.