electrum

Electrum Bitcoin wallet
git clone https://git.parazyd.org/electrum
Log | Files | Refs | Submodules

commit 4f2aa53a7657fb90bcdd74b6e1fa48c545fcadd7
parent 0c1ea909dfc0c7645d135b06cb101f7a12f51c3e
Author: SomberNight <somber.night@protonmail.com>
Date:   Fri, 12 Apr 2019 19:11:25 +0200

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

closes #5246

Diffstat:
Melectrum/interface.py | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/electrum/interface.py b/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)