0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-09 10:43:19 -05:00
bitcoin-bitcoin-core/src/wallet
Wladimir J. van der Laan f09bc7ec98
Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting down
c1dde3a949 No longer shutdown after encrypting the wallet (Andrew Chow)
d7637c5a3f After encrypting the wallet, reload the database environment (Andrew Chow)
5d296ac810 Add function to close all Db's and reload the databae environment (Andrew Chow)
a769461d5e Move BerkeleyEnvironment deletion from internal method to callsite (Andrew Chow)

Pull request description:

  This is the replacement for #11678 which implements @ryanofsky's [suggestion](https://github.com/bitcoin/bitcoin/pull/11678#pullrequestreview-76464511).

  Shutting down the software was to prevent the BDB environment from writing unencrypted private keys to disk in the database log files, as was noted [here](https://bitcointalk.org/index.php?topic=51474.msg616068#msg616068). This PR replaces the shutdown behavior with a CDBEnv flush, close, and reopen which achieves the same effect: everything is cleanly flushed and closed, the log files are removed, and then the environment reopened to continue normal operation.

  To ensure that no unencrypted private keys are in the log files after encrypting the wallet, I wrote [this script](https://gist.github.com/achow101/7f7143e6c3d3fdc034d3470e72823e9d) to pull private keys from the original wallet file and searches for these keys in the log files (note that you will have to change your file paths to make it work on your own machine).

  As for concerns about private keys being written to slack space or being kept in memory, these behaviors no longer exist after the original wallet encryption PR and the shutting down solution from 2011.

  cc @ryanofsky

Tree-SHA512: 34b894283b0677a873d06dee46dff8424dec85a2973009ac9b84bcf3d22d05f227c494168c395219d9aee3178e420cf70d4b3eeacc9785aa86b6015d25758e75
2018-09-14 10:43:35 +02:00
..
test Merge #13419: [tests] Speed up knapsack_solver_test by not recreating wallet 100 times. 2018-09-11 10:22:36 +02:00
coincontrol.cpp Add -avoidpartialspends and m_avoid_partial_spends 2018-07-24 15:05:37 +09:00
coincontrol.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
coinselection.cpp util: Replace boost::signals2 with std::function 2018-08-24 08:34:38 -04:00
coinselection.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
crypter.cpp Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2018-08-27 18:19:33 +02:00
crypter.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
db.cpp Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting down 2018-09-14 10:43:35 +02:00
db.h Add function to close all Db's and reload the databae environment 2018-08-09 11:27:39 -07:00
feebumper.cpp [wallet] Kill accounts 2018-08-30 16:08:42 +02:00
feebumper.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
fees.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
fees.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
init.cpp [build] remove ENABLE_WALLET ifdef from httprpc.cpp 2018-09-10 14:27:32 -04:00
rpcdump.cpp Merge #9332: Let wallet importmulti RPC accept labels for standard scriptPubKeys 2018-09-10 19:02:44 +02:00
rpcwallet.cpp Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting down 2018-09-14 10:43:35 +02:00
rpcwallet.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
wallet.cpp Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting down 2018-09-14 10:43:35 +02:00
wallet.h Merge #10605: Add AssertLockHeld assertions in CWallet::ListCoins 2018-08-31 09:03:05 -04:00
walletdb.cpp Merge #13249: Make objects in range declarations immutable by default. Avoid unnecessary copying of objects in range declarations. 2018-09-04 15:50:08 +02:00
walletdb.h [wallet] Kill accounts 2018-08-30 16:08:42 +02:00
walletutil.cpp Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
walletutil.h Update copyright headers to 2018 2018-07-27 07:15:02 -04:00