diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2018-02-11 12:14:08 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2018-02-12 10:30:48 +0100 |
commit | d44cd7ed4b494b64f93b395abc2476ef3f1b5028 (patch) | |
tree | f3c1f675e82a1c69f73da039b5dc61813c9e2e7d /src | |
parent | a5e3d44cc8f61f03a94d57302ff8c33c8f8a8689 (diff) |
Reset pblocktree before deleting LevelDB file
Github-Pull: #12401
Rebased-From: a8b5d20f4f171828b2bd70ab2405c42b1e452e5b
Tree-SHA512: 3a87b6113283c3588f46bb5c725ec33ac639e2f91c589b5c0eb4375e3d23bd6c18e7ba96faf70be2afea86d8e6252bf4dbcf9c9ed166ce2d49846ff947a36d2e
Diffstat (limited to 'src')
-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 c02917aac1..0896ad0d29 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) { |