mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Merge pull request #5864
bb6acff
fix possible block db breakage during re-index (Cory Fields)
This commit is contained in:
commit
45b7dc2c25
1 changed files with 4 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue