#11043 repaced:
0delete pblocktree;
1pblocktree = new CBlockTreeDB(nBlockTreeDBCache, false, fReset);
With:
0pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset));
This is problematic because new CBlockTreeDB
tries to delete the existing file, which will fail with LOCK: already held by process
if it’s still open. That’s the case for QT.
When QT finds a problem with the index it will ask the user if they want to reindex. At that point it has already opened blocks/index
. It then runs this while loop again with fReset = 1
, resulting in the above error.
This change makes that error go away, presumably because reset()
without an argument closes the file.