bitcoin/bitcoin — pull request #4875 by sdaftuar (2014-09-08 19:27:32+00:00)
Title: When reindexing check for file before trying to open

Fix for #4693 -- check for each file before trying to open, so an error is only logged if the file exists but is unreadable.

I thought about refactoring the code so that the way you map from a file number to a path is done in one function only, but the assumption that block files look like "blkNNNNN.dat" is in several places, including comments and debug messages, so wasn't sure such a refactor was warranted compared with this simple fix.