Ejemplo n.º 1
0
 /**
  *
  */
 private function update()
 {
     $header = $this->index->getHeader();
     // Check all active features
     if ($header->getTimestamp() >= $this->params->p2shActivateTime()) {
         $this->p2sh = true;
     }
     $hash = $this->index->getHash()->getBinary();
     $this->bip30 = !($this->index->getHeight() == 91842 && $hash == pack("H*", "00000000000a4d0a398161ffc163c503763b1f4360639393e0e4c8e300e0caec") || $this->index->getHeight() == 91880 && $hash == pack("H*", "00000000000743f190a18c5577a3c2d2a1f610ae9601ac046a38084ccb7cd721"));
     $highest = $this->majorityVersion();
     if ($highest >= 2) {
         $this->bip34 = true;
     }
     if ($highest >= 3) {
         $this->derSig = true;
     }
     if ($highest >= 4) {
         $this->cltv = true;
     }
     // Calculate flags
     $this->flags = $this->p2sh ? InterpreterInterface::VERIFY_NONE : InterpreterInterface::VERIFY_P2SH;
     if ($this->derSig) {
         $this->flags |= InterpreterInterface::VERIFY_DERSIG;
     }
     if ($this->cltv) {
         $this->flags |= InterpreterInterface::VERIFY_CHECKLOCKTIMEVERIFY;
     }
 }
Ejemplo n.º 2
0
 /**
  * @param int|string $currentTime
  * @return bool
  */
 public function scriptVerifyPayToScriptHash($currentTime)
 {
     return $this->math->cmp($currentTime, $this->params->p2shActivateTime()) >= 0;
 }