diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2018-02-11 12:14:08 +0100 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2018-02-11 12:14:08 +0100 |
commit | a8b5d20f4f171828b2bd70ab2405c42b1e452e5b (patch) | |
tree | beff8292730edb510c67d192770cd909b507242c /src/init.cpp | |
parent | 89005ddad1c4a9732ecae47c7de34b4de157f48f (diff) |
Reset pblocktree before deleting LevelDB file
Diffstat (limited to 'src/init.cpp')
-rw-r--r-- | src/init.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp index 84398d978c..4ff875f9aa 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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) { |