/** * @param BlockIndexInterface $index */ public function next(BlockIndexInterface $index) { if (!$this->index->isNext($index)) { throw new \InvalidArgumentException('Provided Index does not elongate this Chain'); } $this->index = $index; $this->emit('tip', [$index]); }
/** * @param BlockIndexInterface $index * @return bool */ public function isNext(BlockIndexInterface $index) { return $this->index->isNext($index); }