1
0

qt "open channel" dialog: detect invalid remote node id sooner

and avoid the "please wait" text to be interpreted as a node id

related #6705
This commit is contained in:
SomberNight
2020-11-13 19:21:37 +01:00
parent 46e59d18f5
commit c872c3194f
3 changed files with 11 additions and 4 deletions

View File

@@ -1203,7 +1203,8 @@ def extract_nodeid(connect_contents: str) -> Tuple[bytes, str]:
raise ConnStringFormatError(_('At least a hostname must be supplied after the at symbol.'))
try:
node_id = bfh(nodeid_hex)
assert len(node_id) == 33, len(node_id)
if len(node_id) != 33:
raise Exception()
except:
raise ConnStringFormatError(_('Invalid node ID, must be 33 bytes and hexadecimal'))
return node_id, rest