mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 13:03:17 +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;
|
nLastBlockFile = nFile;
|
||||||
vinfoBlockFile[nFile].nSize += nAddSize;
|
|
||||||
vinfoBlockFile[nFile].AddBlock(nHeight, nTime);
|
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) {
|
if (!fKnown) {
|
||||||
unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;
|
unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;
|
||||||
|
Loading…
Reference in New Issue
Block a user