Skip to content

Commit a2a5f3f

Browse files
committed
wallet: Base backup filenames on original wallet filename
1 parent b823a4c commit a2a5f3f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wallet/db.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ CDBEnv::VerifyResult CDBEnv::Verify(const std::string& strFile, recoverFunc_type
163163
bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& newFilename)
164164
{
165165
// Recovery procedure:
166-
// move wallet file to wallet.timestamp.bak
166+
// move wallet file to walletfilename.timestamp.bak
167167
// Call Salvage with fAggressive=true to
168168
// get as much data as possible.
169169
// Rewrite salvaged data to fresh wallet file
170170
// Set -rescan so any missing transactions will be
171171
// found.
172172
int64_t now = GetTime();
173-
newFilename = strprintf("wallet.%d.bak", now);
173+
newFilename = strprintf("%s.%d.bak", filename, now);
174174

175175
int result = bitdb.dbenv->dbrename(NULL, filename.c_str(), NULL,
176176
newFilename.c_str(), DB_AUTO_COMMIT);

0 commit comments

Comments
 (0)