Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

JsonRpcError (response["error"]) on master pull #628

Open
bobberb opened this issue Oct 7, 2016 · 3 comments
Open

JsonRpcError (response["error"]) on master pull #628

bobberb opened this issue Oct 7, 2016 · 3 comments

Comments

@bobberb
Copy link

bobberb commented Oct 7, 2016

`2016-10-07 15:13:15,645 [MainThread ] [DEBUG] requesting wallet history

2016-10-07 15:13:15,807 [MainThread ] [DEBUG] rpc: getaddressesbyaccount ['joi
nmarket-wallet-5a28f4']

Traceback (most recent call last):
File "wallet-tool.py", line 107, in
jm_single().bc_interface.sync_wallet(wallet)
File "/home/josh/working/joinmarket/joinmarket/blockchaininterface.py", line 7
8, in sync_wallet
self.sync_addresses(wallet)
File "/home/josh/working/joinmarket/joinmarket/blockchaininterface.py", line 6
40, in sync_addresses
imported_addr_list = self.rpc('getaddressesbyaccount', [wallet_name])
File "/home/josh/working/joinmarket/joinmarket/blockchaininterface.py", line 5
77, in rpc
res = self.jsonRpc.call(method, args)
File "/home/josh/working/joinmarket/joinmarket/jsonrpc.py", line 117, in call
raise JsonRpcError(response["error"])
joinmarket.jsonrpc.JsonRpcError`

Bitcoin.conf unchanged

@AdamISZ
Copy link
Member

AdamISZ commented Oct 15, 2016

This tends to happen if you haven't configured rpc access to your Bitcoin Core node correctly. The sanity check is to try to run an rpc command with the same username and password as set in joinmarket.cfg, but do it on the command line. You can come on #joinmarket on freenode or cgan if you need more help debugging.

@bobberb
Copy link
Author

bobberb commented Oct 16, 2016

Dear @AdamISZ

bitcoin-cli runs fine, passing this sanity check yes? (and I do feel like I'm going insane :( )

@AdamISZ
Copy link
Member

AdamISZ commented Oct 19, 2016

@bobberb Was debugging a similar scenario for another user on IRC, we discovered: if you have previously imported one of the addresses in your Joinmarket wallet to your Bitcoin Core wallet (i.e. the default account "") (this could happen if you used -p to extract the private key, and then imported that key into Bitcoin Core), then attempting to sync your Joinmarket wallet will cause this error, because it will complain that you already own this address+private key (the error is {u'id': 3, u'result': None, u'error': {u'message': u'The wallet already contains the private key for this address or script', u'code': -4}}, although that's hidden), so you can't also import it as watch-only.

The only easy solution I saw, if this is the case, is to create a fresh wallet.dat for running Joinmarket separately to your normal wallet. I don't like this solution, it's a bit clunky, also you may find that you need to -rescan again (not sure). Your JM wallet should recognize then that that address has been used, and will not try to use it again for receiving, although if it has funds, it may (will, eventually) spend those funds. Depending on your situation, it might be easier to make a fresh JM wallet.

Relevant perhaps is this pull request to Bitcoin Core: bitcoin/bitcoin#8694

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

No branches or pull requests

3 participants
@bobberb @AdamISZ and others