diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-11-17 14:21:32 -0500 |
---|---|---|
committer | Luke Dashjr <luke-jr+git@utopios.org> | 2011-11-17 14:29:18 -0500 |
commit | c4a3bf9e552f25a5ad0efb8cf62d344a7dad53ed (patch) | |
tree | aafa2dc7d55650358dd822825dfcc7a2ac415023 /src/wallet.cpp | |
parent | 90de05e88ecc879b75315eebacb488b44353f5d9 (diff) | |
download | bitcoin-c4a3bf9e552f25a5ad0efb8cf62d344a7dad53ed.tar.xz |
Only remove database log files on shutdown after wallet encryption/rewrite
Diffstat (limited to 'src/wallet.cpp')
-rw-r--r-- | src/wallet.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/wallet.cpp b/src/wallet.cpp index 9b9586face..737f0e6238 100644 --- a/src/wallet.cpp +++ b/src/wallet.cpp @@ -194,8 +194,8 @@ bool CWallet::EncryptWallet(const string& strWalletPassphrase) // Need to completely rewrite the wallet file; if we don't, bdb might keep // bits of the unencrypted private key in slack space in the database file. - setKeyPool.clear(); - CDB::Rewrite(strWalletFile); + if (CDB::Rewrite(strWalletFile)) + RemoveLogFilesOnShutdown(true); } return true; @@ -1134,6 +1134,7 @@ int CWallet::LoadWallet(bool& fFirstRunRet) { if (CDB::Rewrite(strWalletFile, "\x04pool")) { + RemoveLogFilesOnShutdown(true); setKeyPool.clear(); // Note: can't top-up keypool here, because wallet is locked. // User will be prompted to unlock wallet the next operation |