cashshuffle / cashshuffle-electron-cash-plugin

Electron cash cash-shuffle plugin
27 stars 13 forks source link

Crash when connection refused #23

Closed ifol closed 6 years ago

ifol commented 6 years ago

The plugin should handle network errors gracefully, this doesn't appear to be the case. And then, there is an error inside of an error, it seems the plugin is really clunky at the time:


<ssl.SSLSocket fd=27, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=0, laddr=('0.0.0.0', 0)>
Traceback (most recent call last):
  File "[...]/Electron Cash-3.1.2/plugins/shuffle/commutator_thread.py", line 63, in connect
    self.socket.connect((host, port))
  File "/usr/lib/python3.5/ssl.py", line 1027, in connect
    self._real_connect(addr, False)
  File "/usr/lib/python3.5/ssl.py", line 1014, in _real_connect
    socket.connect(self, addr)
ConnectionRefusedError: [Errno 111] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "[...]/Electron Cash-3.1.2/plugins/shuffle/qt.py", line 259, in <lambda>
    self.coinshuffle_start_button = EnterButton(_("Shuffle"),lambda :self.start_coinshuffle_protocol())
  File "[...]/Electron Cash-3.1.2/plugins/shuffle/qt.py", line 215, in start_coinshuffle_protocol
    self.pThread = protocolThread(server, port, self.window.network, amount, fee, sk, pub_key, output_address, change_address, logger = logger, ssl = ssl)
  File "[...]/Electron Cash-3.1.2/plugins/shuffle/client.py", line 49, in __init__
    self.commutator.connect(host, port)
  File "[...]/Electron Cash-3.1.2/plugins/shuffle/commutator_thread.py", line 67, in connect
    self.logger.put(str(e))
AttributeError: 'NoneType' object has no attribute 'put'
clifordsymack commented 6 years ago

Hi @ifol ! Thanks fro reply. This error appaer with connection errors. Yes i should handle it more carefully. I plan to do it

clifordsymack commented 6 years ago

Should work now.