commenting out part of flatfile.dump, which is causing data corruption

This commit is contained in:
Evan Duffield 2016-05-19 14:27:09 -07:00
parent deb0f0ca14
commit 49b8123ae1
2 changed files with 22 additions and 15 deletions

View File

@ -201,22 +201,25 @@ public:
int64_t nStart = GetTimeMillis();
LogPrintf("Verifying %s format...\n", strFilename);
ReadResult readResult = Read(objToSave, true);
// there was an error and it was not an error on file opening => do not proceed
if (readResult == FileError)
LogPrintf("Missing file - %s, will try to recreate\n", strFilename);
else if (readResult != Ok)
{
LogPrintf("Error reading %s: ", strFilename);
if(readResult == IncorrectFormat)
LogPrintf("magic is ok but data has invalid format, will try to recreate\n");
else
{
LogPrintf("file format is unknown or invalid, please fix it manually\n");
return false;
}
}
// 12.1 -- pls fix -- causing corruption of the dat files ---
// ReadResult readResult = Read(objToSave, true);
// // there was an error and it was not an error on file opening => do not proceed
// if (readResult == FileError)
// LogPrintf("Missing file - %s, will try to recreate\n", strFilename);
// else if (readResult != Ok)
// {
// LogPrintf("Error reading %s: ", strFilename);
// if(readResult == IncorrectFormat)
// LogPrintf("magic is ok but data has invalid format, will try to recreate\n");
// else
// {
// LogPrintf("file format is unknown or invalid, please fix it manually\n");
// return false;
// }
// }
LogPrintf("Writting info to %s...\n", strFilename);
Write(objToSave);

View File

@ -191,6 +191,8 @@ void Interrupt(boost::thread_group& threadGroup)
/** Preparing steps before shutting down or restarting the wallet */
void PrepareShutdown()
{
LogPrintf("1 %s\n", governance.ToString());
fRequestShutdown = true; // Needed when we shutdown the wallet
fRestartRequested = true; // Needed when we restart the wallet
LogPrintf("%s: In progress...\n", __func__);
@ -199,6 +201,8 @@ void PrepareShutdown()
if (!lockShutdown)
return;
LogPrintf("2 %s\n", governance.ToString());
/// Note: Shutdown() must be able to handle cases in which AppInit2() failed part of the way,
/// for example if the data directory was found to be locked.
/// Be sure that anything that writes files or flushes caches only does this if the respective