Rename BLOCK_HAVE_DATA
and BLOCK_HAVE_UNDO
to BLOCK_STORED_DATA/ BLOCK_STORED_UNDO
.
These status values now indicate that a block or its undo information has been stored on disk, but pruning could cause that data to no longer be present.
HaveBlockData()
uses vinfoBlockFile
to determine whether we actually have block
data for a given block, and updates the CBlockIndex
passed in when BLOCK_STORED_DATA
was set to true but the block file has been pruned.
Also remove the iteration of mapBlockIndex
in PruneOneBlockFile()
, as we no
longer need to update the CBlockIndex
entries of the blocks referenced in a
pruned file.
@sipa Is this along the lines of what you had in mind?