示例#1
0
 /**
  * @param Utxo $utxo
  */
 private function addUtxo(Utxo $utxo)
 {
     if (!isset($this->utxo[$utxo->getTransactionId()])) {
         $this->utxo[$utxo->getTransactionId()] = [$utxo->getVout() => $utxo];
     } else {
         $this->utxo[$utxo->getTransactionId()][$utxo->getVout()] = $utxo;
     }
 }
示例#2
0
 /**
  * @param Utxo $utxo
  */
 public function cache(Utxo $utxo)
 {
     $index = $this->getInternalIndex($utxo->getTransactionId(), $utxo->getVout());
     $this->cache->save($index, $utxo, 5 * 60);
 }
 /**
  * @param Utxo $utxo
  * @return $this
  */
 public function spendUtxo(Utxo $utxo)
 {
     $this->addInput(new TransactionInput($utxo->getTransactionId(), $utxo->getVout()));
     return $this;
 }