mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
Merge pull request #5864
bb6acff
fix possible block db breakage during re-index (Cory Fields)
This commit is contained in:
commit
45b7dc2c25
@ -2454,8 +2454,11 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd
|
||||
}
|
||||
|
||||
nLastBlockFile = nFile;
|
||||
vinfoBlockFile[nFile].nSize += nAddSize;
|
||||
vinfoBlockFile[nFile].AddBlock(nHeight, nTime);
|
||||
if (fKnown)
|
||||
vinfoBlockFile[nFile].nSize = std::max(pos.nPos + nAddSize, vinfoBlockFile[nFile].nSize);
|
||||
else
|
||||
vinfoBlockFile[nFile].nSize += nAddSize;
|
||||
|
||||
if (!fKnown) {
|
||||
unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;
|
||||
|
Loading…
Reference in New Issue
Block a user