Beispiel #1
0
 /**
  * @param OutPointInterface $outpoint
  * @return Utxo
  */
 public function fetch(OutPointInterface $outpoint)
 {
     $key = $outpoint->getTxId()->getBinary() . $outpoint->getVout();
     if (!isset($this->utxo[$key])) {
         throw new \RuntimeException('Utxo not found in this UtxoView');
     }
     return $this->utxo[$key];
 }
 /**
  * @param OutPointInterface $outpoint
  * @return \BitWasp\Buffertools\Buffer
  */
 public function serialize(OutPointInterface $outpoint)
 {
     return $this->getTemplate()->write([$outpoint->getTxId(), $outpoint->getVout()]);
 }
Beispiel #3
0
 /**
  * @param OutPointInterface $outpoint
  * @return array
  */
 public function convertOutpointToArray(OutPointInterface $outpoint)
 {
     return ['txid' => $outpoint->getTxId()->getHex(), 'vout' => $outpoint->getVout()];
 }