Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: symbol node info set host when empty #25

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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