aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPieter Wuille <sipa@ulyssis.org>2014-07-16 21:46:01 +0200
committerPieter Wuille <sipa@ulyssis.org>2014-07-16 21:46:01 +0200
commit09c744c2a845f756adbcf8716c2365b63731f467 (patch)
treeb3a4cd5478623315dc99fbff2259dd6278f67581 /src
parent87e40799fdebb9f4c3c9d8cc7d071408a4ea768e (diff)
Make sure CAutoFile for fees estimate goes out of scope
Diffstat (limited to 'src')
-rw-r--r--src/init.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 07960ee37b..b80d718f01 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -127,12 +127,14 @@ void Shutdown()
StopNode();
UnregisterNodeSignals(GetNodeSignals());
- boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
- CAutoFile est_fileout = CAutoFile(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION);
- if (est_fileout)
- mempool.WriteFeeEstimates(est_fileout);
- else
- LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
+ {
+ boost::filesystem::path est_path = GetDataDir() / FEE_ESTIMATES_FILENAME;
+ CAutoFile est_fileout(fopen(est_path.string().c_str(), "wb"), SER_DISK, CLIENT_VERSION);
+ if (est_fileout)
+ mempool.WriteFeeEstimates(est_fileout);
+ else
+ LogPrintf("%s: Failed to write fee estimates to %s\n", __func__, est_path.string());
+ }
{
LOCK(cs_main);