danuker / piggies

A package to automatically manage your cryptocurrency wallets.
MIT License
5 stars 0 forks source link

Closing XMR wallet breaks jsonrpclib #5

Open danuker opened 6 years ago

danuker commented 6 years ago

When attempting to close the XMR wallet (server.stop_wallet()), the response received by jsonrpclib is None, and it can't get its result.

This only happens sometimes.

Find out why and fix it, so that we can make sure the wallet is stopped.

Stopping RPC server for XMR...
Traceback (most recent call last):
  File "./demo.py", line 87, in <module>
    main()
  File "./demo.py", line 81, in main
    mp.stop_servers()
  File "/home/dan/PycharmProjects/Piggies/piggies/master_piggy.py", line 55, in stop_servers
    self.piggies[p].stop_server()
  File "/home/dan/PycharmProjects/Piggies/piggies/piggy_xmr.py", line 146, in stop_server
    self.server.stop_wallet()
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 290, in __call__
    return self.__send(self.__name, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/jsonrpclib/jsonrpc.py", line 239, in _request
    return response['result']
TypeError: 'NoneType' object has no attribute '__getitem__'
danuker commented 6 years ago

Marked as an enhancement, since now it doesn't crash anymore, but we should make sure that the wallet stopped.