Fix handing of "Wrong PIN"

This commit is contained in:
Dain Nilsson 2024-10-23 09:26:27 +02:00
parent 353766bc01
commit 5f8a668f4a
No known key found for this signature in database
GPG Key ID: F04367096FBA95E8

View File

@ -505,8 +505,13 @@ class ConnectionNode(RpcNode):
raise ChildResetException(str(e))
raise
except Exception as e: # TODO: Replace with ConnectionError once added
if "Wrong" in str(e):
raise ChildResetException(str(e))
words = str(e).split()
try:
word = words[words.index("Wrong") + 1]
if word in ("nonce", "channel", "sequence"):
raise ChildResetException(str(e))
except ValueError:
pass
raise
@property