Bitcoin Forum
May 22, 2024, 02:40:05 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin-QT, reindex or build all new blockchain  (Read 1953 times)
soy (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1013



View Profile
December 18, 2013, 03:59:10 AM
 #1

Went to backup my wallet.  Had difficulty getting it saved to a USB drive.  Ended up copying it as root.  That was two days ago.  Have been on terminal rather than KDE so didn't notice the client wasn't keeping up to date.  Today it was 2 day behind when I went back to KDE.  It didn't catch up.  I checked the debug log and was getting a lot of orphaned blocks.

I deleted peers.dat but that didn't help.

I've started reindexing, currently 123 weeks behind.  I wonder if I'm making a mistake and should instead rebuild the blockchain.  I'm wondering if when I get to 2 days behind I'll start running into the orphaned blocks problem again.
soy (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1013



View Profile
December 18, 2013, 02:44:42 PM
Last edit: December 18, 2013, 09:00:30 PM by soy
 #2

Went to backup my wallet.  Had difficulty getting it saved to a USB drive.  Ended up copying it as root.  That was two days ago.  Have been on terminal rather than KDE so didn't notice the client wasn't keeping up to date.  Today it was 2 day behind when I went back to KDE.  It didn't catch up.  I checked the debug log and was getting a lot of orphaned blocks.

I deleted peers.dat but that didn't help.

I've started reindexing, currently 123 weeks behind.  I wonder if I'm making a mistake and should instead rebuild the blockchain.  I'm wondering if when I get to 2 days behind I'll start running into the orphaned blocks problem again.

Woke up this morning to 78 weeks behind but a large notification System error: Database corrupted.

Just looked in my ./.bitcoin directory and see a ./.lock file from about the past.  Deleted it but still get Database corrupted.

Rebooted, restarted Bitcoin-QT, am now at 78 weeks behind and apparently sync'ing.  So, the hidden file ./.lock, located with ls -la, may have been the bug.  Presently at 77 weeks behind.  Wish I had found that lock file before commencing a reindex.....

reindex failed.  Have deleted all files except wallet.dat, which has coins, and restarted building the blockchain.
soy (OP)
Legendary
*
Offline Offline

Activity: 1428
Merit: 1013



View Profile
December 19, 2013, 12:24:14 AM
Last edit: December 23, 2013, 04:05:46 AM by soy
 #3

Went to backup my wallet.  Had difficulty getting it saved to a USB drive.  Ended up copying it as root.  That was two days ago.  Have been on terminal rather than KDE so didn't notice the client wasn't keeping up to date.  Today it was 2 day behind when I went back to KDE.  It didn't catch up.  I checked the debug log and was getting a lot of orphaned blocks.

I deleted peers.dat but that didn't help.

I've started reindexing, currently 123 weeks behind.  I wonder if I'm making a mistake and should instead rebuild the blockchain.  I'm wondering if when I get to 2 days behind I'll start running into the orphaned blocks problem again.

Woke up this morning to 78 weeks behind but a large notification System error: Database corrupted.

Just looked in my ./.bitcoin directory and see a ./.lock file from about the past.  Deleted it but still get Database corrupted.

Rebooted, restarted Bitcoin-QT, am now at 78 weeks behind and apparently sync'ing.  So, the hidden file ./.lock, located with ls -la, may have been the bug.  Presently at 77 weeks behind.  Wish I had found that lock file before commencing a reindex.....

reindex failed.  Have deleted all files except wallet.dat, which has coins, and restarted building the blockchain.

Well, that failed.  At 64 weeks behind I got a System error: Database corrupted.  How can that be?  The only file left was the wallet.dat, including all the subdirectories.

Guess I'll have to go to a backup wallet.dat and try building with that.

Wonder if it could be the hard drive.  Previously the hard drive was two partitions.  I used gparted to grow the volume to double the partition size.  Right now it's only showing usage of 13%.

debug.log says CDB() : can't open database file wallet.dat, error 2       bitcoin in a Runaway exception

removed the lock, killed the process, ran bitcoind -salvagewallet and am retrying

Okay, so I then restarted Bitcoin-QT with the -salvagewallet switch.  It loaded the wallet.dat file, verified blocks, rescanned, and opened at 64 weeks behind.  This isn't a backup wallet it's the original.  It has restarted building the blockchain at the point it had come up with the wallet.dat error 2.

Oh well, somehow it started building a new wallet and the contents changed from unconfirmed some btc to unconfirmed 0.00btc but it is down to 55 weeks.  Time to swap the wallet.dat out for a backup copy and start again is my guess.  ...muddling my way thru.

loading block index...
verifying blocks...
loading wallet...
rescanning....
done...
synchronizing 55 weeks behind and showing transaction history and unconfirmed balance....now if it gets to present day eventually all well and good.


So, I've learned that if a backup wallet.dat is put into the bitcoin directory and Bitcoin-QT restarted, a whole new blockchain isn't downloaded, all that happens is that the blockchain is rescanned which is much quicker than downloading the blockchain.  This makes cold storage seem a more reasonable option.

-----

Odd.  Up in the middle of the night and checked the progression of the blockchain.  It was okay but the Ubuntu had a message displayed about some gnome applet failing to load and did I want to delete it.  I just ignored the message and went back to bed.  This morning the desktop was clear, no Bitcoin-QT but also no taskbar.  I rebooted and Bitcoin-QT came up with a corrupt wallet message.  Killed the Bitcoin-QT, deleted the wallet.dat, deleted the peers.dat (the last messages in the debug.log were regarding something like repeated flushing of peers.dat), removed the lock file and replaced the wallet.dat with the backup copy from earlier this month.  At this point ps aux could find no instance of Bitcoin and the lock file had been removed.  Rebooting should not have restarted Bitcoin-QT as it was shut down and not running.  So, I rebooted and let things settle after logging in.  Low and behold an instance of Bitcoin-QT did open, the wallet had the proper amount of btc as unconfirmed, and blockchain building recommenced and is ongoing now.

Some hours later it has again come up with database corrupted.  Will try with a new wallet so see if the error is introduced by the wallet.dat.

--------------------

Blockchain download is so slow I'm wondering if it's de facto depreciated.

--------------------

Got down to 30 weeks, saw the post to get the daily blockchain and put it in the blocks directory after deleting as directed and reindexing, then found reindexing was really no quicker than downloading bootstrap.dat file and loading from that.  But in deleting and restarting I put myself back and seem to be redoing work.  It is slow going.  *Big mistake deleting an existing blockchain.*
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!