Hi,
If a user uses the --reindex command to download the block chain this works fine. However if you stop it midway for what ever reason for example:
- Computer Crash
- Not leaving computer on for days
- Running out of disk space
Then in this case you need to use the --reindex command again.
However it takes forever to recheck each already downloaded blk000*.dat file before continuing to reindex.
Currently on my machine my blocks are reindexing between 5-26 seconds per block. (My Machine: Mac Mini with External HDD)
Do you think it would be a good idea to use file hashing checks to speed up this process for example on ubuntu you can run this command:
sha256sum blk00000.dat
which returns this hash
be88bbfc0c09b3527e71f38fe14ba8693d35271d15bfdca57567429e06671003
Would it be possible to create another .dat file containing all blk file hashes.
Then this file can be cross referenced against your file system to ensure it matches.
As long as each node contains a copy of the same file, then this block-hashes.dat type file
can be redownloaded from a peer or a hash check to compare it with your current block-hashes.dat file.
Then your computer can cross reference each file sha256sum with the block-hashes.dat file to speed up the process.
Then i think this would speed up the duplicate --reindex by up to 8-10x faster depending on your machine
Currently my blocks are reindexing between 5-26 seconds per block.
If this was using the sha256sum it would take about 3 seconds per block on a standard HDD
Im am sure SSD would probably be even faster.
I believe the change would need to be made in this file https://github.com/bitcoin/bitcoin/blob/f1239b70d116ea28b65e60993a6e4ac82cc6c2b1/src/validation.cpp
near line 4611
I would do this myself yet i am not a C programmer.
- Does anybody think this would be an improvement.
- would anybody like to implement this update?
- I think this would take about 15 minutes to add this feature for a fluent c programmer.