Skip to content

Commit

Permalink
Reset pblocktree before deleting LevelDB file
Browse files Browse the repository at this point in the history
Github-Pull: #12401
Rebased-From: a8b5d20
Tree-SHA512: 3a87b6113283c3588f46bb5c725ec33ac639e2f91c589b5c0eb4375e3d23bd6c18e7ba96faf70be2afea86d8e6252bf4dbcf9c9ed166ce2d49846ff947a36d2e
  • Loading branch information
Sjors authored and laanwj committed Feb 12, 2018
1 parent a5e3d44 commit d44cd7e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/init.cpp
Expand Up @@ -1425,6 +1425,9 @@ bool AppInitMain()
pcoinsTip.reset();
pcoinsdbview.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));

if (fReset) {
Expand Down

0 comments on commit d44cd7e

Please sign in to comment.