aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wallet/db.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet/db.cpp b/src/wallet/db.cpp
index 408713c0c6..7e7fd24a8c 100644
--- a/src/wallet/db.cpp
+++ b/src/wallet/db.cpp
@@ -126,11 +126,16 @@ void BerkeleyEnvironment::Close()
}
}
+ FILE* error_file = nullptr;
+ dbenv->get_errfile(&error_file);
+
int ret = dbenv->close(0);
if (ret != 0)
LogPrintf("BerkeleyEnvironment::Close: Error %d closing database environment: %s\n", ret, DbEnv::strerror(ret));
if (!fMockDb)
DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);
+
+ if (error_file) fclose(error_file);
}
void BerkeleyEnvironment::Reset()