The QueuedBlock struct contains a fValidatedHeaders
field that indicates whether we have already validated a header for the requested block. Since headers-first syncing, we only request blocks where the header is already validated, so fValidatedHeaders
is always true. Remove it and clean up the logic that uses that field.
Likewise, QueuedBlock contains a hash
field that is set to the block hash. Since headers-first syncing, we always have a CBlockIndex, which contains the block hash, so remove the redundant hash
field.
Tidy up the logic and rename functions to better indicate what they’re doing.