When rewinding, remove insufficiently-validated blocks
If a block is insufficiently-validated against a particular branch ID, then we cannot guarantee that even the block header will be valid under the actual consensus rules the node will want to apply. Instead require that the blocks are completely re-validated, by removing them from the block index (which is equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).
This commit is contained in:
@@ -59,6 +59,7 @@ private:
|
||||
void operator=(const CBlockTreeDB&);
|
||||
public:
|
||||
bool WriteBatchSync(const std::vector<std::pair<int, const CBlockFileInfo*> >& fileInfo, int nLastFile, const std::vector<const CBlockIndex*>& blockinfo);
|
||||
bool EraseBatchSync(const std::vector<const CBlockIndex*>& blockinfo);
|
||||
bool ReadBlockFileInfo(int nFile, CBlockFileInfo &fileinfo);
|
||||
bool ReadLastBlockFile(int &nFile);
|
||||
bool WriteReindexing(bool fReindex);
|
||||
|
||||
Reference in New Issue
Block a user