Author

Topic: block explorer, bitcoin client BTC amount discrepancy (Read 1687 times)

newbie
Activity: 24
Merit: 0
Is this a bug? ...or is it normal behaviour to have to execute " -rescan" when switching wallet files?

Normal.  The client only looks for new transactions.  The reason why is an old wallet could have hundreds (maybe thousands) of addresses and those addresses could be involved in transactions back to block 1 (if your are Satoshi).

To query the entire blockchain every single time you start would be massive amount of work.

SO the client remembers what it has last seen.  If the client knows your balance is 20 BTC @ block 100 and you turn it off, when you turn it on it downloads block 101 to 105.  It only needs to look for transactions in blocks 101 to 105.  Right?

When you switch wallets that confuses the client.  You need to do a rescan to force it to check blocks it considers "already checked".

Thanks for this explanation.  I had the same problem as the OP when I first started because I was experimenting sending between different wallets.  I did find the recommendation on doing a -rescan, but didn't get the whole explanation as to why switching wallets caused problems.

"bitcoins not showing up in wallet" <---(for the search engines)
donator
Activity: 1218
Merit: 1079
Gerald Davis
Is this a bug? ...or is it normal behaviour to have to execute " -rescan" when switching wallet files?

Normal.  The client only looks for new transactions.  The reason why is an old wallet could have hundreds (maybe thousands) of addresses and those addresses could be involved in transactions back to block 1 (if your are Satoshi).

To query the entire blockchain every single time you start would be massive amount of work.

SO the client remembers what it has last seen.  If the client knows your balance is 20 BTC @ block 100 and you turn it off, when you turn it on it downloads block 101 to 105.  It only needs to look for transactions in blocks 101 to 105.  Right?

When you switch wallets that confuses the client.  You need to do a rescan to force it to check blocks it considers "already checked".
legendary
Activity: 1904
Merit: 1002
Eh, I spoke too soon. After I verified that my bitcoin client registered my coins, I:

1. deleted my wallet from "~/.bitcoin" (no data loss; my backup is still intact)
2. re-ran ./bitcoin-qt so that it would generate a new wallet
3. moved the new wallet.dat file to a backup
4. re-copied my origianl wallet from my backup into "~/.bitcoin"
5. ran ./bitcoin-qt

Bitcoin started and again displayed 0.00 BTC. So, I:

1. closed my bitcoin client
2. executed `./bitcoin-qt -rescan`

This successfully registered my coins agian.

Is this a bug? ...or is it normal behaviour to have to execute " -rescan" when switching wallet files?

The client only remembers transactions involving the addresses in the wallet file you are using.  It has to reread all the block when you change wallets.  That is what -rescan does.
newbie
Activity: 5
Merit: 0
Eh, I spoke too soon. After I verified that my bitcoin client registered my coins, I:

1. deleted my wallet from "~/.bitcoin" (no data loss; my backup is still intact)
2. re-ran ./bitcoin-qt so that it would generate a new wallet
3. moved the new wallet.dat file to a backup
4. re-copied my origianl wallet from my backup into "~/.bitcoin"
5. ran ./bitcoin-qt

Bitcoin started and again displayed 0.00 BTC. So, I:

1. closed my bitcoin client
2. executed `./bitcoin-qt -rescan`

This successfully registered my coins agian.

Is this a bug? ...or is it normal behaviour to have to execute " -rescan" when switching wallet files?
newbie
Activity: 5
Merit: 0
Welp, my blockchain finishe downloading, and my coins registered! Not sure why this didn't happen the first time, but I'm fantastically relieved Cheesy

Thanks for all your help!
donator
Activity: 1218
Merit: 1079
Gerald Davis
did you check the number of downloaded blocks against my value?

Not yet. Just before posting this message I created a fresh, new .bitcoin directory and started downloading the blockchain again (when all else fails, reboot). Pulling from TOR while the .bitcoin directory is stored on an encrypted folder on an external drive, the whole blockchain takes >6 hours to download x_x.

I know. I know. I'm ridiculioius..but it's fun for me to do things bullet-proof Smiley [so long as I don't loose BTC in the process!]

My plan:

1. finish getting downloading the blockchain
2. verify the blockchain is fully downloaded (162055 blocks)
3. If 0.00 BTC, Close bitcoin-qt. Run `./bitcoin-qt -rescan`
4. If still 0.00 BTC, checkout strong coin

Side question: Is there a manual page on the bitcoin-qt command outlining its accepted arguments (ie: -rescan)?

Thanks again,
-Ed

https://en.bitcoin.it/wiki/Running_Bitcoin#Command-line_arguments

newbie
Activity: 5
Merit: 0
did you check the number of downloaded blocks against my value?

Not yet. Just before posting this message I created a fresh, new .bitcoin directory and started downloading the blockchain again (when all else fails, reboot). Pulling from TOR while the .bitcoin directory is stored on an encrypted folder on an external drive, the whole blockchain takes >6 hours to download x_x.

I know. I know. I'm ridiculioius..but it's fun for me to do things bullet-proof Smiley [so long as I don't loose BTC in the process!]

My plan:

1. finish getting downloading the blockchain
2. verify the blockchain is fully downloaded (162055 blocks)
3. If 0.00 BTC, Close bitcoin-qt. Run `./bitcoin-qt -rescan`
4. If still 0.00 BTC, checkout strong coin

Side question: Is there a manual page on the bitcoin-qt command outlining its accepted arguments (ie: -rescan)?

Thanks again,
-Ed
donator
Activity: 1218
Merit: 1079
Gerald Davis
EDImuU1t9bu144d5Ct49,

if you can't get it working you could extract the private key and import it into an online wallet like strong coin then make your payment/transfer from there.

Don't worry strongcoin uses client side encryption so your funds are safe.
full member
Activity: 210
Merit: 100
Can you define "verify emperically?" Is there anything I should check besides checking the Bitcoin Address showing in the client after clicking "Recieve Coins" to verify that all is well with my wallet.dat file (permissions, integrity, etc)?

That's pretty much it. If you'd created multiple receiving addresses, you'd see at a glance whether or not they were there.
...or you could debug bitcoin-qt Smiley

You DON'T need the blockchain at all. Just grab the wallet.dat and you're good to go. BTW, did you check the number of downloaded blocks against my value?
newbie
Activity: 5
Merit: 0
I was thinking: Is it necessary to have your bitcoin client download the entire blockchain before backing up the wallet.dat file?

The address in #3 is still showing in the client?

Yes. Clicking "Recieve Coins" in the bitcoin client shows me the same address that I recorded in step #3.

If you're absolutely sure the client is using the symlinked wallet file (have verified it empirically), consider running the client with the --rescan parameter.

Can you define "verify emperically?" Is there anything I should check besides checking the Bitcoin Address showing in the client after clicking "Recieve Coins" to verify that all is well with my wallet.dat file (permissions, integrity, etc)?

If this was the first time you attempted to use bitcoin this way, you should have used a test monkey bit-cent. Free bit-cents can be had here: http://freebitcoins.appspot.com/

Definietly. I absolutely should have tested my method with a few BTC before dropping >50 USD hoping that theory would match implementation without a test run. Thanks for the link, I'll check it out.
full member
Activity: 210
Merit: 100
I'm obliged, DAT Smiley

As to using TOR, if you were able to contact the outside world and download the entire blockchain (that is 162055 blocks), I can't see how it could have been harmful.

EDIT :: Damn it, just lost two miners! It must be some connectivity issue as the remote router doesn't respond either. I won't be able to bring them back online until Monday so let's hope it's the ISP who messed up :<
donator
Activity: 1218
Merit: 1079
Gerald Davis
The address in #3 is still showing in the client?

You can try launching bitcoin from the command line with -rescan option.  It will recheck entire block chain for your transaction.

I agree w/ jake though I think you are making this way to difficult.  There are btw usb linux distros which are secure and come w/ the client.
full member
Activity: 210
Merit: 100
Wow, been through hell to purchase those bitcoins?

Firstly, unless plausible deniability is what you're striving at, there is a much simpler approach to securing the wallet. The client now has the option to encrypt the wallet using a passphrase. Select any decent passphrase and you're good to go.

Secondly, the first thing which comes to my mind is please double-check whether the bitcoin client is actually using the wallet you think it is using. If for some reason (file permissions?) the client can't read your symlinked wallet, it'll generate a new one silently. I had such an issue once with a symlinked config file when I messed up ln syntax but failed to notice the mistake.

If you're absolutely sure the client is using the symlinked wallet file (have verified it empirically), consider running the client with the --rescan parameter.

If this was the first time you attempted to use bitcoin this way, you should have used a test monkey bit-cent. Free bit-cents can be had here: http://freebitcoins.appspot.com/
newbie
Activity: 5
Merit: 0
Hi Bitcontalk!

I just bought my first bitcoins! Blockexplorer shows that I have >14 BTC, but my bitcoin client reads 0.00 BTC. Can you please help me find out why?

Here's what I did (perhaps there is an error in my process):

1. Booted to a live-CD (TAILS)
2. Downloaded bitcoin. ran ./bitcoin-qt
3. Wrote down my Bitcoin Address
4. Closed bitcoin-qt.
5. Copied wallet.dat to an encrypted tarball on an external drive.
6. Shutdown live OS environment.
7. Used get-bitcoin.com to send USD->BTC to my Bitcoin Address in (3).
8. Waited until  blockexplorer showed a balance at my Bitcoin Address.
9. Booted to the live-CD.
10. Downloaded bitcoin.
11. Created an encrypted folder ".bitcoin" on an external drive using Cryptkeeper. Created a symlink to the ".bitcoin" directory on the external drive at "~/.bitcoin".
12. Decrypted tarball from external drive. Copied wallet.dat to "~/.bitcoin"
13. ran ./bitcoin-qt
14. Waited for the entire blockchain to be downloaded.
15. Saw 0.00 BTC
16. Re-checked blockexplorer; verified I should have >14 BTC.
17. WTF
18. Registered for bitcointalk forums.

Also, I'm using TOR, so bitcoin-qt is configured to connect to the 127.0.0.1 SOCKS proxy--in case that makes any differences.

TIA!
Jump to: