aboutsummaryrefslogtreecommitdiff
path: root/src/wallet
diff options
context:
space:
mode:
authorJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-01-31 00:04:51 +0000
committerJoão Barbosa <joao.paulo.barbosa@gmail.com>2019-02-04 12:22:55 +0000
commit8602a1e6aeca65911e4d4c821d3575147ba32a7e (patch)
tree677d586a761a8c1e7ba982e870e52f97044567fa /src/wallet
parent64127b3098a1aab70200b6d07194dce072ad5cf2 (diff)
wallet: Close dbenv error file db.log
The error file db.log is opened by BerkeleyEnvironment instance and should be closed after dbenv is closed.
Diffstat (limited to 'src/wallet')
-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 ae40553268..24911846ed 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()