Function forest_filecoin::ipld::util::unordered_stream_chain
source · pub fn unordered_stream_chain<DB: Blockstore + Sync + Send + 'static, T: Iterator<Item = Tipset> + Unpin + Send + 'static>(
db: Arc<DB>,
tipset_iter: T,
stateroot_limit: i64,
) -> UnorderedChainStream<DB, T>
Expand description
Stream all blocks that are reachable before the stateroot_limit
epoch in an unordered 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.