mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 12:02:48 +01:00
Warn about a special case - less than 60 seconds between restarts i.e. backup file name is the same as previos one. Continue and do not disable automatic backups in this case
.
This commit is contained in:
parent
0ba15486bb
commit
f3a24944f0
@ -956,6 +956,12 @@ bool AutoBackupWallet (CWallet* wallet, std::string strWalletFile, std::string&
|
||||
fs::path backupFile = backupsDir / (strWalletFile + dateTimeStr);
|
||||
sourceFile.make_preferred();
|
||||
backupFile.make_preferred();
|
||||
if (fs::exists(backupFile))
|
||||
{
|
||||
strBackupWarning = _("Failed to create backup, file already exists! This could happen if you restarted wallet in less than 60 seconds. You can continue if you are ok with this.");
|
||||
LogPrintf("%s\n", strBackupWarning);
|
||||
return false;
|
||||
}
|
||||
if(fs::exists(sourceFile)) {
|
||||
try {
|
||||
fs::copy_file(sourceFile, backupFile);
|
||||
|
Loading…
Reference in New Issue
Block a user