After encrypting the wallet, reload the database environment
Calls ReloadDbEnv after encrypting the wallet so that the database environment is flushed, closed, and reopened to prevent unencrypted keys from being saved on disk.
This commit is contained in:
parent
5d296ac810
commit
d7637c5a3f
1 changed files with 5 additions and 0 deletions
|
@ -719,6 +719,11 @@ bool CWallet::EncryptWallet(const SecureString& strWalletPassphrase)
|
|||
// bits of the unencrypted private key in slack space in the database file.
|
||||
database->Rewrite();
|
||||
|
||||
// BDB seems to have a bad habit of writing old data into
|
||||
// slack space in .dat files; that is bad if the old data is
|
||||
// unencrypted private keys. So:
|
||||
database->ReloadDbEnv();
|
||||
|
||||
}
|
||||
NotifyStatusChanged(this);
|
||||
|
||||
|
|
Loading…
Reference in a new issue