public function testVersionWithoutBlockchain() { $factory = new Factory(Bitcoin::getDefaultNetwork(), new Random()); $v = '60002'; $services = Buffer::hex('0000000000000000'); $time = (string) time(); $recipient = new NetworkAddress(Buffer::hex('1'), '10.0.0.1', '8332'); $sender = new NetworkAddress(Buffer::hex('1'), '10.0.0.2', '8332'); $userAgent = new Buffer("/Satoshi:0.7.2/"); $lastBlock = '212672'; $version = $factory->version($v, $services, $time, $recipient, $sender, $userAgent, $lastBlock, true); $this->assertFalse($version->hasBlockchain()); }
/** * @return \BitWasp\Bitcoin\Networking\Messages\Version */ public function version() { $this->send($this->msgs->version(self::PROTOCOL_VERSION, Buffer::hex('0000000000000001', 8), time(), $this->remoteAddr, $this->localAddr, new Buffer(self::USER_AGENT), '363709', $this->relayToUs)); }
/** * @param int $protocolVersion * @param int $services * @param int $timestamp * @param NetworkAddressInterface $remoteAddr * @param NetworkAddressInterface $localAddr * @param string $userAgent * @param int $blockHeight * @param bool $relayToUs */ public function version($protocolVersion, $services, $timestamp, NetworkAddressInterface $remoteAddr, NetworkAddressInterface $localAddr, $userAgent, $blockHeight, $relayToUs) { $this->send($this->msgs->version($protocolVersion, $services, $timestamp, $remoteAddr, $localAddr, new Buffer($userAgent), $blockHeight, $relayToUs)); }