diff options
| author | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 11:08:34 -0300 |
|---|---|---|
| committer | Nsable-sh <nsable-sh@noreply.git.bitflash.network> | 2026-08-14 11:08:34 -0300 |
| commit | dd9db5ba5407b9c30b4f41fc1153db39f0770154 (patch) | |
| tree | f39a99147d9265ed9bb98bb830cdf0919c3ba56d /src/selftest.cpp | |
| parent | bf62d480ae5d76c04d1a8b27750f51596473cc85 (diff) | |
wallet: install backups via temporary file
Diffstat (limited to 'src/selftest.cpp')
| -rw-r--r-- | src/selftest.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/selftest.cpp b/src/selftest.cpp index 638aa66..81c4439 100644 --- a/src/selftest.cpp +++ b/src/selftest.cpp | |||
| @@ -1391,6 +1391,13 @@ static int RunWalletPortabilitySelfTest() | |||
| 1391 | nFail += Check(nBackupRet == 0 && FileExists(strPortableWallet.c_str()), | 1391 | nFail += Check(nBackupRet == 0 && FileExists(strPortableWallet.c_str()), |
| 1392 | "/backupwallet writes a portable wallet.dat") ? 0 : 1; | 1392 | "/backupwallet writes a portable wallet.dat") ? 0 : 1; |
| 1393 | 1393 | ||
| 1394 | string strBackupOut2 = tmp + "/backupwallet-overwrite.txt"; | ||
| 1395 | int nBackupRet2 = RunBitflashChild(strExe, vBackupArgs, NULL, &strBackupOut2); | ||
| 1396 | nFail += Check(nBackupRet2 == 0 && FileExists(strPortableWallet.c_str()) && | ||
| 1397 | !DirectoryHasFileWithPrefix(tmp, "portable-wallet.dat.tmp.") && | ||
| 1398 | !DirectoryHasFileWithPrefix(tmp, "portable-wallet.dat.old."), | ||
| 1399 | "/backupwallet replaces an existing backup without leaving temp files") ? 0 : 1; | ||
| 1400 | |||
| 1394 | nFail += Check(CopyFileLocal(strOriginal + "/wallet.dat", | 1401 | nFail += Check(CopyFileLocal(strOriginal + "/wallet.dat", |
| 1395 | strRawCopy + "/wallet.dat"), | 1402 | strRawCopy + "/wallet.dat"), |
| 1396 | "a raw wallet.dat can be copied without database logs") ? 0 : 1; | 1403 | "a raw wallet.dat can be copied without database logs") ? 0 : 1; |