Author

Topic: Weird bug in bitcoin core qt for some people, is there a command to remedy? (Read 232 times)

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
I don't know why those old issue were brought-up since those are already closed due to being solved by an old PR.
Perhaps OP is still using an old Bitcoin Core version?

For what it's worth, the issues linked in this topic should've been solved by this PR that was merged in Dec 2021,
because it's now utilizing the "internal" flag on top of the simple marking logic.
Link: wallet: Automatically add receiving destinations to the address book #22929
Refer to #2 use-case.

If it happened in the latest version, this is worth reporting in GitHub, only if you can show a way to reproduce the issue.
(I can't using the provided steps above)
member
Activity: 103
Merit: 18
When you restore from and older wallet.dat file sometimes all the new received addresses you have generated on your more updated wallet.dat are for some reason now labelled as change addresses so are kind of invisible to a novice user.
By design, the wallet believes that payment addresses are actual change, but they are not fixed so that each transaction does not appear multiple times.

You can solve this problem by deleting this line https://github.com/bitcoin/bitcoin/blob/d0f81a96d9c158a9226dc946bdd61d48c4d42959/src/wallet/wallet.cpp#L1756

Code:
if (pwallet->IsChange(txout))

and recompile

You can see discussions on this topic here https://github.com/bitcoin/bitcoin/issues/16160

Thanks for this information. It is a bit advanced for me but I'm certain other people here can do this.

Thanks NotaTether I think this is important to know.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
1 slight issue may be if you wanted to dump priv keys and you forgot about the change addresses.
So coin control can be used to check.

The thing is, you can only try this troubleshooting method on legacy wallets, as descriptor wallets don't support dumping yet.
hero member
Activity: 630
Merit: 510
When you restore from and older wallet.dat file sometimes all the new received addresses you have generated on your more updated wallet.dat are for some reason now labelled as change addresses so are kind of invisible to a novice user.
By design, the wallet believes that payment addresses are actual change, but they are not fixed so that each transaction does not appear multiple times.

You can solve this problem by deleting this line https://github.com/bitcoin/bitcoin/blob/d0f81a96d9c158a9226dc946bdd61d48c4d42959/src/wallet/wallet.cpp#L1756

Code:
if (pwallet->IsChange(txout))

and recompile

You can see discussions on this topic here https://github.com/bitcoin/bitcoin/issues/16160
member
Activity: 103
Merit: 18
Can anyone tell me the command to see all addresses in my wallet that have received coins.

Listreceivedbyaddress 0 true does not work. It does not show addresses I know that have funds on because the overview shows those addresses receiving coins and the total balance.

The QT overview shows the correct balance. But now I've restored from an older wallet.dat. All receive addresses I made after this backup seem hidden or just vanished. This is very strange and a bit worrying.

Is there a command that just shows every address with coins on inside your wallet.dat?

Edit 2/ after lots of googling I find this is a known issue or bug.


https://github.com/bitcoin/bitcoin/issues/20293

https://bitcoin.stackexchange.com/questions/88434/listreceivedbyaddress-missing-transactions-after-restore

So although listreceivedbyaddress does not show these addresses have received coins because of some label issue
Does it matter? I mean the wallet.dat seemingly does not acknowledge these addresses at all or has no label for them but can still spend from them?


Edit/ it seems if you make a new wallet.dat make 1 recieve address send bitcoin to this address.
Then make multiple copies of that wallet.dat as backups.

Now if you make more receive addresses and send coins to them after a time and your machine breaks.

When you go to your backup wallet.dat and reload into a new qt wallet.
Those new recieve addresses that have recieved coins. Will never appear.
Like if you keep clicking generate new receive address it will skip past those that have recieved coins.
If you type type listreceivedbyaddress 0 true or listreceivedbyaddress  1 true
It will never show those addresses? However it will show the original receive address and the initial coins you sent to it.

This is very strange? It worries me I can not seem to make the qt demonstrate I still control those addresses.
Its like they just never existed. Although you can see the tx shown on the overview page of the qt ?


https://bitcoin.stackexchange.com/questions/88434/listreceivedbyaddress-missing-transactions-after-restore

Edit3/

Okay so eventually I solved this and I will relay what I found here for others just because it may happen to you.

When you restore from and older wallet.dat file sometimes all the new received addresses you have generated on your more updated wallet.dat are for some reason now labelled as change addresses so are kind of invisible to a novice user.

This causes some strange things to happen.

Listreceivedbyaddress 0 true will not show these addresses

When you generate new receiving addresses these addresses even if unused will never show up so it seems that it is making different addresses in a different order to a more recently used wallet.dat. Depending on how many new received addresses you made on the more recently used wallet.dat before then resorting to restoring from an old wallet.dat you may need to create lots of new addresses before you see them creating the same exact addresses on both machines.

To see them and check you still have these addresses under your control in this wallet.dat
You can simply click on coin control and then under the send tab click on inputs

This will then show you all of your addresses and all of the coins on those addresses.
So now you can relax. The coins are still inside that wallet.dat and you can spend them.

I am not sure why this happens but maybe it is not a bug it is just a bit confusing to a novice.
1 moment these were receiving addresses you could see and next moment these are invisible change addresses.
But no matter you still have control of the coins.

1 slight issue may be if you wanted to dump priv keys and you forgot about the change addresses.
So coin control can be used to check.


Jump to: