Bitcoin Forum
November 17, 2024, 09:48:21 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin -rescan questions  (Read 9391 times)
Arsenal (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
May 03, 2011, 10:08:08 PM
 #1

Someone told me that if I decrypt my wallet.dat and put it back in its original location that the BTC balance the client says could differ from the useable number of BTC in that wallet.dat unless I use -rescan or redownload the entire block chain.

My questions are:
1. After I use -rescan would there be any situation where the client would display a balance different from the number of BTC I could actually spend/use?
2. How long does -rescan take or is there a way to display its progress other than watching the LED's on the front of my case?
3. Is there anyway to know if my current downloaded blockchain is corrupted or incorrect in any way?
4. Is there any reason not to start bitcoin with -rescan?

Thanks.
BitterTea
Sr. Member
****
Offline Offline

Activity: 294
Merit: 252



View Profile
May 03, 2011, 10:10:06 PM
 #2

You may not need to use -rescan anymore. As of the latest version (0.3.21, I think) the client stores the index of the last scanned block in the wallet. Once the client starts (or is it before?), it will automatically rescan all block after the stored index, finding any transactions not already in the wallet.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5390
Merit: 13426


View Profile
May 04, 2011, 02:26:53 AM
 #3

-rescan is apparently broken for 0-confirmation transactions. In cases where a 0-confirmation transaction gets stuck, you'll have to delete the block database files. It'll be obvious when this happens.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
BitterTea
Sr. Member
****
Offline Offline

Activity: 294
Merit: 252



View Profile
May 04, 2011, 03:16:19 AM
 #4

Yep, I've had that happen a few times. Probably because I was switching between wallets so running with -rescan all the time.
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1181


View Profile WWW
May 05, 2011, 12:36:45 PM
 #5

-rescan is apparently broken for 0-confirmation transactions. In cases where a 0-confirmation transaction gets stuck, you'll have to delete the block database files. It'll be obvious when this happens.

Rescan is for searching the block chain for transactions that are from or to one of your addresses. A 0-confirmation transaction is one that never made it into the block chain. This could be because it was never transmitted, because it was ignored by miners for a while, or because it conflicts somehow with other transactions. If deleting and redownloading the block chain does make a difference, there is something seriously wrong, and we have a bug to fix.

I do Bitcoin stuff.
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5390
Merit: 13426


View Profile
May 05, 2011, 12:40:42 PM
 #6

If deleting and redownloading the block chain does make a difference, there is something seriously wrong, and we have a bug to fix.

That's what I mean. Once a transaction gets stuck at 0 confirmations (in the block chain, but not detected by the client), deleting the block database will help, but -rescan won't.

I haven't had this happen to me, but I've read several cases of it on the forum.

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
AvL42
Full Member
***
Offline Offline

Activity: 216
Merit: 100


View Profile
October 07, 2012, 03:07:02 PM
 #7

While this topic is a bit aged, I hope that someone still "watches" it...

It's not clear to me, what -rescan actually does:
  Does it scan the local copy of the blockchain in order to update
       any wrong/missing transactions in the wallet,
  or does it verify the local copy of the blockchain itself through the net?

I've got some transactions in the wallet that were never confirmed,
and the bitcoin client doesn't ever seem to "forget" about them, nor
allow me to manually purge them.

Since the transactions were never confirmed, I don't expect my local
blockchain to be wrong with respect to these transactions, so wouldn't
want to risk wasting almost 4GB extra traffic.

Is -rescan the right tool for my problem, or is there some tool to
purge table-lines from the wallet.dat at the command-line(linux), or is
calling dumpprivkey on all my addresses, then removing the wallet
and importprivkey'ing them into the new wallet the only way to fix it?
Pieter Wuille
Legendary
*
Offline Offline

Activity: 1072
Merit: 1181


View Profile WWW
October 07, 2012, 03:08:29 PM
 #8

-rescan scans the local block chain copy for transactions that are missing from the wallet.

It does not remove transactions from the wallet which are in conflict with it.

I do Bitcoin stuff.
nomnomnom
Sr. Member
****
Offline Offline

Activity: 313
Merit: 250



View Profile
October 07, 2012, 10:18:12 PM
 #9

Hello,

I've got some transactions in the wallet that were never confirmed,
and the bitcoin client doesn't ever seem to "forget" about them, nor
allow me to manually purge them.

one time I fixed a wallet like this, by deleting all transactions with pywallet (https://github.com/jackjack-jj/pywallet)
Start it with the --web option then scroll down to delete keys, select tx and type all. Afterwards start bitcoin with the -rescan option.

But please make backups first in case something goes wrong. Related thread: https://bitcointalk.org/index.php?topic=105041.0
Werner
Member
**
Offline Offline

Activity: 107
Merit: 10



View Profile
October 08, 2012, 07:07:45 AM
 #10

just learned that rescan aso can fix my problem. thank!
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!