Merge pull request #512 from crowning-/v0.12.0.x

V0.12.0.x fix bug with wallet-backups
This commit is contained in:
evan82 2015-08-11 14:56:05 -07:00
commit be801aadea

View File

@ -900,7 +900,7 @@ bool AppInit2(boost::thread_group& threadGroup)
if (filesystem::exists(backupDir))
{
// Create backup of the wallet
std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H.%M", GetTime());
std::string dateTimeStr = DateTimeStrFormat(".%Y-%m-%d-%H-%M", GetTime());
std::string backupPathStr = backupDir.string();
backupPathStr += "/" + strWalletFile;
std::string sourcePathStr = GetDataDir().string();
@ -930,7 +930,7 @@ bool AppInit2(boost::thread_group& threadGroup)
{
currentFile = dir_iter->path().filename();
// Only add the backups for the current wallet, e.g. wallet.dat.*
if(currentFile.string().find(strWalletFile) != string::npos)
if(dir_iter->path().stem().string() == strWalletFile)
{
folder_set.insert(folder_set_t::value_type(boost::filesystem::last_write_time(dir_iter->path()), *dir_iter));
}