Abstracts away the network communications; silently enforces configuration (e.g. tor-only mode).
Ejemplo n.º 1
0
 /**
  * Fetch all of the updates from the remote server.
  *
  * @param Channel $chan
  * @param string $url
  * @param string $root Which Merkle root are we starting at?
  * @return TreeUpdate[]
  */
 protected function fetchTreeUpdates(Channel $chan, string $url, string $root) : array
 {
     try {
         return $this->parseTreeUpdateResponse($chan, $this->hail->getSignedJSON($url . API::get('fetch_keys') . '/' . $root, $chan->getPublicKey()));
     } catch (SignatureFailed $ex) {
         $state = State::instance();
         if (IDE_HACKS) {
             $state->logger = new Ledger();
         }
         $state->logger->alert('Signature failed!', \Airship\throwableToArray($ex));
     }
     return [];
 }