Exemplo n.º 1
0
 /**
  * Initialize the block storage with genesis and chain
  * @param BlockHeaderInterface $header
  */
 public function init(BlockHeaderInterface $header)
 {
     $hash = $header->getHash();
     try {
         $this->db->fetchIndex($hash);
     } catch (\Exception $e) {
         $this->db->insertIndexGenesis(new BlockIndex($hash->getHex(), 0, 0, $header));
     }
 }