From c8b2e4426b78e63c0e9565688192963331221984 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 4 Dec 2012 23:46:30 +0100 Subject: [PATCH] Update the block file counter in database when using -reindex This problem is like earth (mostly harmless). After/during a -reindex, it means the statistics about the last block file reported in debug.log are always of blk00000.dat instead of the last file. Apart from that, it means a few more database entries need to be read when finding a file to append to the first time. --- src/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.cpp b/src/main.cpp index ed03414173..0e0be2f01e 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1897,6 +1897,7 @@ bool FindBlockPos(CDiskBlockPos &pos, unsigned int nAddSize, unsigned int nHeigh nLastBlockFile = pos.nFile; infoLastBlockFile.SetNull(); pblocktree->ReadBlockFileInfo(nLastBlockFile, infoLastBlockFile); + fUpdatedLast = true; } } else { while (infoLastBlockFile.nSize + nAddSize >= MAX_BLOCKFILE_SIZE) {