Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled error on opening wallet created on different computer in JoinMarketQt #341

Closed
kristapsk opened this issue Apr 5, 2019 · 4 comments · Fixed by #342
Closed

Unhandled error on opening wallet created on different computer in JoinMarketQt #341

kristapsk opened this issue Apr 5, 2019 · 4 comments · Fixed by #342

Comments

@kristapsk
Copy link
Member

Wallet jmdat file was created when testing coincontrol branch. Now copied it to a different computer and tried opening in JoinMarketQt, with current master. Unhandled error happened, Qt "JM Wallet" tab was left with "No wallet loaded..." message, but "Coins" tab shows all UTXO's of wallet. Console output:

2019-04-06 00:18:39,661 [INFO]  Detected new wallet, performing initial import
restart Bitcoin Core with -rescan if you're recovering an existing wallet from backup seed
Otherwise just restart this joinmarket application.
Unhandled Error
Traceback (most recent call last):
  File "joinmarket-qt.py", line 1766, in <module>
    sys.exit(app.exec_())
  File "/home/neonz/git/joinmarket-clientserver/jmvenv/lib/python3.6/site-packages/qt5reactor/core.py", line 292, in iterate_qt
    self.iterate(delay=delay, fromqt=True)
  File "/home/neonz/git/joinmarket-clientserver/jmvenv/lib/python3.6/site-packages/qt5reactor/core.py", line 286, in _iterate
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/home/neonz/git/joinmarket-clientserver/jmvenv/lib/python3.6/site-packages/twisted/internet/base.py", line 902, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "joinmarket-qt.py", line 1521, in syncWalletUpdate
    restart_cb=restart_cb)
  File "/fast_home/neonz/git/joinmarket-clientserver/jmclient/jmclient/blockchaininterface.py", line 399, in sync_wallet
    self.sync_wallet_fast(wallet)
  File "/fast_home/neonz/git/joinmarket-clientserver/jmclient/jmclient/blockchaininterface.py", line 411, in sync_wallet_fast
    self.get_address_usages(wallet)
  File "/fast_home/neonz/git/joinmarket-clientserver/jmclient/jmclient/blockchaininterface.py", line 439, in get_address_usages
    self.sync_addresses(wallet)
  File "/fast_home/neonz/git/joinmarket-clientserver/jmclient/jmclient/blockchaininterface.py", line 514, in sync_addresses
    wallet_name, restart_cb)
  File "/fast_home/neonz/git/joinmarket-clientserver/jmclient/jmclient/blockchaininterface.py", line 393, in add_watchonly_addresses
    sys.exit(0)
builtins.SystemExit: 0

Also, coins aren't imported into Bitcoin Core, bitcoin-cli listunspent does not show them.

Then I did restart Bitcoin Core and also JoinMarketQt and did open the same wallet file again. Now JoinMarketQt again outputted initial wallet imported message in console, shows that wallet is empty, "JM Wallet" tab does not show used addresses and starts showing generated mixdepth(s) addresses only after the used coins and "Coins" tab shows "No coins". But both bitcoin-qt and bitcoin-cli listunspent 0 9999999 now shows only one watch-only UTXO from that wallet, the one which is still unconfirmed for some days.

wallet-tool.py display shows that one address which was imported into Bitcoin Core with correct amount, with displayall I can also get non-imported addresse(s), which are correct, but, obviously with zero amounts in them, as they aren't imported into Bitcoin Core.

Not a coin loss issue, as I have privkeys and the same wallet working on another computer, but could be stressful for less experienced users who for some strange reason :), could decide to do the same thing as I did. Anyway, even at least some shitty GUI error message in JoinMarketQt would be better than current behaviour.

@kristapsk
Copy link
Member Author

Finally, was able to get back to this. Tried to do the same, with a fresh Bitcoin Core wallet. Result is almost the same, but this time all UTXO's were confirmed and now they all appeared in wallet. Behaviour with "JM Wallet" tab showing "no wallet loaded" and "Coins" tab showing UTXO's is the same (except for now showing all the coins). Message about the need to restart the wallet appears only on console, unhandled error message and the stack trace is the same.

So, I see multiple bugs / potential fixes here:

  1. Seems that initial wallet import does not like unconfirmed coins.
  2. If the restart is required, GUI message should be displayed about that and application closed.

This time I changed loglevel to DEBUG in joinmarket.cfg, but not much more information is displayed, at least nothing obvious, will need to look at the code.

2019-04-11 00:04:42,592 [DEBUG]  Looking for wallet in: ('XXX', 'All Files (*)')
2019-04-11 00:04:48,652 [DEBUG]  rpc: listaddressgroupings []
2019-04-11 00:04:53,410 [INFO]  Detected new wallet, performing initial import
2019-04-11 00:04:53,410 [DEBUG]  requesting detailed wallet history
2019-04-11 00:04:53,433 [DEBUG]  rpc: getaddressesbyaccount ['joinmarket-wallet-XXXXXX']
2019-04-11 00:05:07,925 [DEBUG]  importing 62 addresses with label joinmarket-wallet-XXXXXX

@kristapsk
Copy link
Member Author

But after restarting wallet, now it does not show coins cointaining balances at all.

@kristapsk
Copy link
Member Author

Reason likely is that this time initial wallet import didn't import any of the UTXO's into Bitcoin Core.

@kristapsk
Copy link
Member Author

Ahh, my fault, didn't do -rescan, that recovers wallet.

Still, I see things could be made more user friendly for the GUI. First, display messages in GUI, close instead of showing "half-loaded" wallet tabs. Secondly, if we already know "Detected new wallet, performing initial import", import could be done with importmulti with requesting rescan automatically, with a Yes/No confirmation from the user (don't think it's so important for cli users, but could really help for people in future probably using GUI only). Also, that unhandled error (keeping this open because of that, other things are just potential improvements in UX).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant