Browse Source

interface: in server.version, send "electrum/3.3.4" as client name

closes #5246
regtest_lnd
SomberNight 6 years ago
parent
commit
4f2aa53a76
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 6
      electrum/interface.py

6
electrum/interface.py

@ -403,7 +403,7 @@ class Interface(PrintError):
self.session.interface = self
self.session.default_timeout = self.network.get_network_timeout_seconds(NetworkTimeout.Generic)
try:
ver = await session.send_request('server.version', [version.ELECTRUM_VERSION, version.PROTOCOL_VERSION])
ver = await session.send_request('server.version', [self.client_name(), version.PROTOCOL_VERSION])
except aiorpcx.jsonrpc.RPCError as e:
raise GracefulDisconnect(e) # probably 'unsupported protocol version'
if exit_early:
@ -600,6 +600,10 @@ class Interface(PrintError):
self.print_error("exiting backward mode at", height)
return height, header, bad, bad_header
@classmethod
def client_name(cls) -> str:
return f'electrum/{version.ELECTRUM_VERSION}'
def _assert_header_does_not_check_against_any_chain(header: dict) -> None:
chain_bad = blockchain.check_header(header) if 'mock' not in header else header['mock']['check'](header)

Loading…
Cancel
Save