Exemple #1
0
 /**
  * @param BlockData $blockData
  */
 public function applyBlock(BlockData $blockData)
 {
     $this->db->updateUtxoSet($this->outpointSerializer, $blockData);
     if ($this->caching) {
         foreach ($this->cacheHits as $key) {
             $this->set->delete($key);
         }
         foreach ($blockData->remainingNew as $c => $utxo) {
             $new = $this->outpointSerializer->serialize($utxo->getOutPoint())->getBinary();
             $this->set->save($new, [$utxo->getOutput()->getValue(), $utxo->getOutput()->getScript()->getBinary()], 500000);
         }
         echo "Inserts: " . count($blockData->remainingNew) . " | Deletes: " . count($blockData->requiredOutpoints) . " | " . "CacheHits: " . count($this->cacheHits) . PHP_EOL;
         $this->cacheHits = [];
     }
 }
Exemple #2
0
 /**
  * @param OutPointSerializerInterface $serializer
  * @param BlockData $blockData
  */
 public function updateUtxoSet(OutPointSerializerInterface $serializer, BlockData $blockData)
 {
     echo __FUNCTION__ . PHP_EOL;
     return $this->db->updateUtxoSet($serializer, $blockData);
 }
Exemple #3
0
 /**
  * @param BlockData $blockData
  */
 public function applyBlock(BlockData $blockData)
 {
     $this->db->updateUtxoSet($this->outpointSerializer, $blockData);
 }