/** * ChainView constructor. * @param ChainContainer $container * @param ChainSegment $segment * @param BlockIndexInterface $block */ public function __construct(ChainContainer $container, ChainSegment $segment, BlockIndexInterface $block) { $this->container = $container; $this->segments = $this->container->getHistory($segment); $this->segment = $segment; $this->block = $block; foreach ($this->segments as $segment) { $heights = $container->getHeights($segment); $this->heightMap = array_merge($this->heightMap, $heights); } $this->blockView = new GuidedChainView($container, $this, $block); }