示例#1
0
 public function testNetworkSerializer()
 {
     $net = Bitcoin::getDefaultNetwork();
     $factory = new Factory($net, new Random());
     $locator = new BlockLocator([Buffer::hex('4141414141414141414141414141414141414141414141414141414141414141')], Buffer::hex('0000000000000000000000000000000000000000000000000000000000000000'));
     $getblocks = $factory->getblocks('1', $locator);
     $serialized = $getblocks->getNetworkMessage()->getBuffer();
     $parsed = $factory->parse(new Parser($serialized))->getPayload();
     $this->assertEquals($getblocks, $parsed);
 }
示例#2
0
 /**
  * @param BlockLocator $locator
  */
 public function getblocks(BlockLocator $locator)
 {
     $this->send($this->msgs->getblocks(self::PROTOCOL_VERSION, $locator));
 }
示例#3
0
 /**
  * @param BlockLocator $locator
  */
 public function getblocks(BlockLocator $locator)
 {
     $this->send($this->msgs->getblocks($this->localVersion->getVersion(), $locator));
 }