lbrycrd/test/functional/test_framework
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
..
__init__.py Rename rpc-tests directory to functional 2017-03-20 10:40:31 -04:00
address.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
authproxy.py Remove assigned but never used local variables 2018-03-29 17:47:12 +02:00
bignum.py Remove unused variables and/or function calls 2017-08-28 15:18:14 +02:00
blocktools.py Fix typos reported by codespell 2018-09-04 13:11:26 +02:00
coverage.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
key.py tests: Remove compatibility code not needed now when we're on Python 3 2018-04-16 09:54:27 +02:00
messages.py qa: Remove unused deserialization code in msg_version 2018-08-23 10:05:43 -04:00
mininode.py qa: Read reject reasons from debug log, not p2p messages 2018-08-31 10:27:19 -04:00
netutil.py tests: Replace usage of tostring() with tobytes() 2018-08-13 19:05:31 -07:00
script.py tests: Use explicit imports 2018-08-13 14:13:39 +02:00
segwit_addr.py Use BIP173 addresses in segwit.py test 2017-09-28 17:29:01 -07:00
siphash.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
socks5.py Update copyright headers to 2018 2018-07-27 07:15:02 -04:00
test_framework.py qa: Run all tests even if wallet is not compiled 2018-09-10 17:53:21 -04:00
test_node.py Merge #12493: [wallet] Reopen CDBEnv after encryption instead of shutting down 2018-09-14 10:43:35 +02:00
util.py [Tests] Rename create_tx and move to blocktools.py 2018-08-09 12:58:35 +02:00