pub fn process_iter<P, B, BB, BH>(
iter: impl Iterator<Item = Result<(BH, BB)>>,
writer: &mut StaticFileProviderRWRefMut<'_, <P as NodePrimitivesProvider>::Primitives>,
provider: &P,
hash_collector: &mut Collector<BlockHash, BlockNumber>,
block_numbers: impl RangeBounds<BlockNumber>,
) -> Result<BlockNumber>where
B: Block<Header = BH, Body = BB>,
BH: FullBlockHeader + Value,
BB: FullBlockBody<Transaction = <<P as NodePrimitivesProvider>::Primitives as NodePrimitives>::SignedTx, OmmerHeader = BH>,
P: DBProvider<Tx: DbTxMut> + NodePrimitivesProvider + BlockWriter<Block = B>,
<P as NodePrimitivesProvider>::Primitives: NodePrimitives<BlockHeader = BH, BlockBody = BB>,Expand description
Imports history from ERA files.
Extracts block headers and bodies from iter and appends them using writer and provider.
Adds on to total_difficulty and collects hash to height using hash_collector.
Skips all blocks below the start_bound of block_numbers and stops when reaching past the
end_bound or the end of the file.
Returns last block height.