Instead of shutting down the entire software after encrypting a wallet, instead just stop and close all of the wallets and then reopen them. This will flush the wallets, clear them from memory, and then reopen them to ensure that no unencrypted keys remain after encrypting.
This is marked as WIP because there are a few bugs that I am still trying to figure out. ~~~is a locking bug that I’m still trying to figure out. After encrypting a wallet from the GUI, the GUI freezes. This appears to be a lock contention issue with cs_KeyStore
at wallet/crypter.cpp:160. However I can’t figure out why this is happening.~~~