Skip to content

Commit 60f9b4b

Browse files
luke-jrrandom-zebra
authored andcommitted
wallet: Base backup filenames on original wallet filename
1 parent e6efa6b commit 60f9b4b

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
@@ -166,14 +166,14 @@ CDBEnv::VerifyResult CDBEnv::Verify(const std::string& strFile, recoverFunc_type
166166
bool CDB::Recover(const std::string& filename, void *callbackDataIn, bool (*recoverKVcallback)(void* callbackData, CDataStream ssKey, CDataStream ssValue), std::string& newFilename)
167167
{
168168
// Recovery procedure:
169-
// move wallet file to wallet.timestamp.bak
169+
// move wallet file to walletfilename.timestamp.bak
170170
// Call Salvage with fAggressive=true to
171171
// get as much data as possible.
172172
// Rewrite salvaged data to fresh wallet file
173173
// Set -rescan so any missing transactions will be
174174
// found.
175175
int64_t now = GetTime();
176-
newFilename = strprintf("wallet.%d.bak", now);
176+
newFilename = strprintf("%s.%d.bak", filename, now);
177177

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

0 commit comments

Comments
 (0)