Browse Source

Reset pblocktree before deleting LevelDB file

Github-Pull: #12401
Rebased-From: a8b5d20f4f171828b2bd70ab2405c42b1e452e5b
Tree-SHA512: 3a87b6113283c3588f46bb5c725ec33ac639e2f91c589b5c0eb4375e3d23bd6c18e7ba96faf70be2afea86d8e6252bf4dbcf9c9ed166ce2d49846ff947a36d2e
0.16
Sjors Provoost 7 years ago committed by Wladimir J. van der Laan
parent
commit
d44cd7ed4b
No known key found for this signature in database
GPG Key ID: 1E4AED62986CD25D
  1. 3
      src/init.cpp

3
src/init.cpp

@ -1425,6 +1425,9 @@ bool AppInitMain()
pcoinsTip.reset(); pcoinsTip.reset();
pcoinsdbview.reset(); pcoinsdbview.reset();
pcoinscatcher.reset(); pcoinscatcher.reset();
// new CBlockTreeDB tries to delete the existing file, which
// fails if it's still open from the previous loop. Close it first:
pblocktree.reset();
pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset)); pblocktree.reset(new CBlockTreeDB(nBlockTreeDBCache, false, fReset));
if (fReset) { if (fReset) {

Loading…
Cancel
Save