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

Deposited some bitcoins to my joinmarket wallet but not showing up although it's already confirmed #1143

Closed
scottcarter2020 opened this issue Jan 11, 2022 · 15 comments · Fixed by #1147

Comments

@scottcarter2020
Copy link

Hello,

So I had a new joinmarket wallet created and deposited some bitcoins successfully to several addresses but when I continued to deposit to the other addresses where each address is used only once, it's not shown on the bitcoin core software nor on the joinmarket wallet although it's confiremd by now by checking the addresses on blockchain explorers.

Nothing changed since the session was started, all of this happened on the same session.

For any possible solution, please show a ELI5 how-to.

Thank you.

@AdamISZ
Copy link
Member

AdamISZ commented Jan 11, 2022

What do you mean by 'session', here? Can you outline your setup, what scripts/Qt/Joininbox/API are you using, what OS.

I'm going to take a guess: perhaps you are running a yieldgenerator, and you added more funds to it while it was still running. Currently it will not show the updated balance in the offer unless you restart it (see #1042 - we have a PR to change that, but there are some tricky points and it's not done yet).

If my guess is wrong, then: refer to the first question.

@scottcarter2020
Copy link
Author

What do you mean by 'session', here?

I meant that once I created the wallet and I kept depositing the bitcoins, I didn't close the Qt or anything, the first few addresses worked flawlessly and the others is not reflecting the balance yet.

Can you outline your setup, what scripts/Qt/Joininbox/API are you using, what OS.

Using Qt 0.8.2 and Bitcoin Core 0.19.1 and OS is Ubuntu 18.04

I guess my problem is like this one, #1103, and maybe rescanblockchain will do the trick for me.

Here is what I did, I generated a new wallet from the JoinMakret-Qt as usual, took each address the qt generated and started depositing into it to tumble the coins later, I did this with like 6 addresses, but for the rest addresses (total 11 addresses I think) the balance is not showing up on the qt or on the bitcoin core although as I said, I didn't restart the OS or the qt or anything and the addresses did receive the coins and it's already confirmed.

@AdamISZ
Copy link
Member

AdamISZ commented Jan 11, 2022

Using Qt 0.8.2

You mean your JoinmarketQt app window is showing v0.8.2 in the 'about' window? That's rather old; we're on version 0.9.4 now.

Bitcoin Core 0.19.1

That's also old. Bitcoin Core is now up to v22 (i.e 0.22.x).

Here is what I did, I generated a new wallet from the JoinMakret-Qt as usual, took each address the qt generated and started depositing into it to tumble the coins later, I did this with like 6 addresses, but for the rest addresses (total 11 addresses I think) the balance is not showing up on the qt or on the bitcoin core although as I said, I didn't restart the OS or the qt or anything and the addresses did receive the coins and it's already confirmed.

Hmm ... did you ever try changing the gap limit? Have you used the wallet against more than one Bitcoin Core instance? (e.g. opened the JM wallet on more than one computer). Did you ever try changing the gap limit? (i believe it's possible in Qt though a little obscure, it may be in the settings menu). Did you fund 11 addresses all in one mixdepth or in several? Are all the 11 addresses you deposited to visible in the Qt app, and showing zero balance, or are they not visible?

Can you try to go into /scripts in your JM installation directory and do python wallet-tool.py --recoversync yourwalletname.jmdat (after doing source ../jmvenv/bin/activate but you might already have done that), this is intended to cover cases when addresses were not imported and/or the wallet has the wrong HD index value; and yes it may require rescanblockchain; but I haven't got enough info yet to know if or why that might be the case).

@scottcarter2020
Copy link
Author

You mean your JoinmarketQt app window is showing v0.8.2 in the 'about' window?

Joinmarket core software version: 0.8.2
JoinmarketQt version: 20
Messaging protocol version: 5

I'm aware it's old, even the Ubuntu version as I'm in the process of upgrading everything but this issue I'm facing had stopped this upgrade.

Hmm ... did you ever try changing the gap limit?

No, as I've never used the Yield Generator.

Have you used the wallet against more than one Bitcoin Core instance? (e.g. opened the JM wallet on more than one computer).

No.

Did you ever try changing the gap limit? (i believe it's possible in Qt though a little obscure, it may be in the settings menu).

No.

Did you fund 11 addresses all in one mixdepth or in several?

All in one mixdepth.

Are all the 11 addresses you deposited to visible in the Qt app, and showing zero balance, or are they not visible?

Visibile in the (External) part in the Qt app and showing zero balance.

Can you try to go into /scripts in your JM installation directory and do python wallet-tool.py --recoversync yourwalletname.jmdat (after doing source ../jmvenv/bin/activate but you might already have done that)

Did that but it didn't solve the problem.

@AdamISZ
Copy link
Member

AdamISZ commented Jan 11, 2022

Thanks. That does make it a bit clearer (perhaps). I might try to reproduce the problem on regtest by continuously funding external addresses. In principle, if you saw the address in the Qt before you funded it (which obviously you must have, which is the intention), then the address would have been imported into Bitcoin Core before you funded it, which means the balance update would get recognized. For that reason, I don't see why gap limit would matter here (it's 6 by default). It might be a bug in how the wallet display functions, rather than how the wallet sync works. I'll take a look.

(At some point you should definitely update to 0.9.4).

@scottcarter2020
Copy link
Author

Thanks, will do.

I wanted to do a rescanblockchain but preferred to wait till I hear back from you. Shall I give this a shot ?

@AdamISZ
Copy link
Member

AdamISZ commented Jan 11, 2022

Yes, feel free to do that if you want. If you provide a block height shortly before you created the wallet it won't take long.

@AdamISZ
Copy link
Member

AdamISZ commented Jan 11, 2022

I have tried to reproduce it on regtest using Joinmarket-Qt.

I succeeded in reproducing the error first described, but only in this weak sense:
After funding the first 6 addresses, all in the same Qt session, the next deposit was not shown on the interface (and the same for 7th, 8th etc). But after right click and 'refresh wallet', they were shown. This definitely is a bug, but I get the impression that you did not see the addresses updated even after restarting Qt? Because I did.

@scottcarter2020
Copy link
Author

Thank you.

I'm currently rescanning the blockchain so I can't try that solution.

I can't remember to be honest about the addresses updated part as I was mainly focused on the bitcoin core that if the balances is shown in the bitcoin core then it will be shown in the qt, that's my assumption.

@scottcarter2020
Copy link
Author

Sorry for being late in replying.

The (rescan) of the blockchain did the trick.

I still don't know whatever this is a bug or what exactly, but I'm happy that we found a solution for this.

Thank you.

@kristapsk
Copy link
Member

@scottcarter2020 I think there were some changes regarding wallet refresh since 0.8.2, so it is very likely you would not get this bug if upgraded to newest version.

@AdamISZ
Copy link
Member

AdamISZ commented Jan 13, 2022

@scottcarter2020 thanks for the report.

@kristapsk as of now I don't think it's because of the old version (I reproduced, kinda, yesterday, on master). I made a lot of progress figuring out what's the cause of this yesterday but got delayed. My current understanding indeed would agree with the finding that a rescan 'fixes', but the bug exists and is related to imports. I'll probably be PR-ing a fix very shortly.

AdamISZ added a commit that referenced this issue Jan 13, 2022
Fixes #1143 (and possibly others). Before this commit,
(index plus gap limit) addresses are imported on sync,
and addresses used by maker/taker in coinjoin are imported,
but when a deposit occurred, bumping the index, further
addresses were not imported. The effect was that it was
possible, if doing a series of deposits to multiple
external addresses in a Qt session, to end up depositing
to an address that was not yet imported. And this results
in the user needing to rescan for Core+JM to recognize the
coins.
After this commit, we ensure all 'gap limit forwards'
addresses, which are displayed as potential deposit addresses
in Joinmarket-Qt, are imported before the display.
@AdamISZ
Copy link
Member

AdamISZ commented Jan 13, 2022

Sorry for being late in replying.

The (rescan) of the blockchain did the trick.

I still don't know whatever this is a bug or what exactly, but I'm happy that we found a solution for this.

Thank you.

@scottcarter2020 see #1147 ; until and unless you update to a version that has that fix, I recommend the following: always close and reopen the Qt app after each deposit. That might be overkill, but it depends on details, and it would be a way to make sure the wallet is synced and the right addresses are always imported. After #1147 it should 'just work' as intended.

@scottcarter2020
Copy link
Author

@AdamISZ You are welcome and thanks for quickly working on a fix for this.

I wanted to note that I've done this before, depositing to several addresses in one xpub, but it's the first time I face this bug.

There is something also I wanted to mention, but I don't know if this is the right place to do or shall I open another issue.

The addresses are not numbered correctly.

In (Index), it goes like this

m/84'/0'/0'/0/0
m/84'/0'/0'/0/1
m/84'/0'/0'/0/2
everything goes well till 9
m/84'/0'/0'/0/9
m/84'/0'/0'/0/11

Where is m/84'/0'/0'/0/10 ?

@AdamISZ
Copy link
Member

AdamISZ commented Jan 13, 2022

@scottcarter2020 It depends. The algorithm is intended to do this, for the external branch (i.e. /0/, the branch for deposits): show the address if it contains coins, and show the next 6 available for future deposits.

If for some reason a deposit is not made into index 10, or if the utxo from index 10 was already spent, while there are coins deposited and currently available in index 8, 9 and 11, then you should see indices: 8, 9, 11, 12, 13, 14, 15, 16, 17.

takinbo pushed a commit to takinbo/joinmarket-clientserver that referenced this issue May 27, 2022
Fixes JoinMarket-Org#1143 (and possibly others). Before this commit,
(index plus gap limit) addresses are imported on sync,
and addresses used by maker/taker in coinjoin are imported,
but when a deposit occurred, bumping the index, further
addresses were not imported. The effect was that it was
possible, if doing a series of deposits to multiple
external addresses in a Qt session, to end up depositing
to an address that was not yet imported. And this results
in the user needing to rescan for Core+JM to recognize the
coins.
After this commit, we ensure all 'gap limit forwards'
addresses, which are displayed as potential deposit addresses
in Joinmarket-Qt, are imported before the display.
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.

3 participants