Merge pull request #4546

09c744c Make sure CAutoFile for fees estimate goes out of scope (Pieter Wuille)
This commit is contained in:
Wladimir J. van der Laan 2014-07-17 13:35:29 +02:00
commit 00b16bc942
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
1 changed files with 8 additions and 6 deletions

View File

@ -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);