Skip to content

Commit

Permalink
Merge pull request #264 from UdjinM6/v0.11.2.x_fix_block_db_corruption
Browse files Browse the repository at this point in the history
V0.11.2.x fix block db corruption
  • Loading branch information
evan82 committed Mar 22, 2015
2 parents 30796a8 + 21c480b commit 97e47da
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2742,8 +2742,11 @@ bool FindBlockPos(CValidationState &state, CDiskBlockPos &pos, unsigned int nAdd
pos.nPos = infoLastBlockFile.nSize;
}

infoLastBlockFile.nSize += nAddSize;
infoLastBlockFile.AddBlock(nHeight, nTime);
if (fKnown)
infoLastBlockFile.nSize = std::max(pos.nPos + nAddSize, infoLastBlockFile.nSize);
else
infoLastBlockFile.nSize += nAddSize;

if (!fKnown) {
unsigned int nOldChunks = (pos.nPos + BLOCKFILE_CHUNK_SIZE - 1) / BLOCKFILE_CHUNK_SIZE;
Expand Down

0 comments on commit 97e47da

Please sign in to comment.