Bitcoind sync process

0

I accidentally deleted all the files that the standard bitcoin client stores to disk, except blk*.dat files. When I run bitcoind, he write that he doing sync. This sync is very very slow. What does bitcoind doing with this blk*.dat files while sync? And why there is need to connect to the internet during sync (it did not work without internet)?

D L

Posted 2017-07-03T09:54:49.850

Reputation: 478

Answers

0

The block files are indexed (the blocks/index subdirectory), and if you just delete the index, bitcoind will assume you have no blocks and start over downloading from the network.

You could instead have used the -reindex option to scan for blocks on disk and rebuild the index. This may still work, but likely won't as you've already started downloading again, and overwriting the existing block files.

Pieter Wuille

Posted 2017-07-03T09:54:49.850

Reputation: 54 032

but why bitcoind download again all raw data from the network?D L 2017-07-03T20:08:41.753

Because it does not know you already have it.Pieter Wuille 2017-07-03T20:22:25.180

the blockchain is linking each new block to a previous block (with the transactions). Hence the chain. When the client doesn't know the structure, it will reload the blockchain. And it verifies not only the blocks, it verifies also the transactions inside the blocks, to be sure your local copy of the block chain has valid data. This requires a connection to the network. More on this in Andreas Antonopolus book "Mastering Bitcoin", or on the bitcoin.org webpages, in the developper section.pebwindkraft 2017-07-04T06:24:53.867