Skip to content

Commit

Permalink
fix: symbol node info set host when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Baha committed Feb 1, 2022
1 parent 63d99c2 commit a9581e2
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions client/SymbolClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@ def get_finalization_info(self):
return FinalizationInfo(0, 0, self._send_socket_request(5, self._parse_chain_statistics_response)['finalizedHeight'])

def get_node_info(self):
return self._send_socket_request(0x111, self._parse_node_info_response)
node_info = self._send_socket_request(0x111, self._parse_node_info_response)
if not node_info['host']:
node_info['host'] = self.node_host

return node_info

@staticmethod
def get_peers():
Expand Down Expand Up @@ -138,7 +142,6 @@ def _parse_node_info_response(reader):
name_size = reader.read_int(1)
node_info['host'] = reader.read_bytes(host_size).decode('utf8')
node_info['friendlyName'] = reader.read_bytes(name_size).decode('utf8')

return node_info


Expand Down Expand Up @@ -172,6 +175,8 @@ def get_harvester_signer_public_key(self, height):

def get_node_info(self):
json_response = self._get_json('node/info')
if not json_response['host']:
json_response['host'] = self.node_host
return json_response

def get_peers(self):
Expand Down

0 comments on commit a9581e2

Please sign in to comment.