aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorSjors Provoost <[email protected]>2018-02-11 12:14:08 +0100
committerSjors Provoost <[email protected]>2018-02-11 12:14:08 +0100
commita8b5d20f4f171828b2bd70ab2405c42b1e452e5b (patch)
treebeff8292730edb510c67d192770cd909b507242c /src/init.cpp
parentMerge #11761: [docs] initial QT documentation (diff)
downloaddiscoin-a8b5d20f4f171828b2bd70ab2405c42b1e452e5b.tar.xz
discoin-a8b5d20f4f171828b2bd70ab2405c42b1e452e5b.zip
Reset pblocktree before deleting LevelDB file
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 84398d978..4ff875f9a 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) {