Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wallet] Reopen CDBEnv after encryption instead of shutting down #2648

Merged
merged 9 commits into from
Jan 11, 2022

Commits on Nov 24, 2021

  1. wallet: Reset BerkeleyDB handle after connection fails

    According to the BerkeleyDB docs, the DbEnv handle may not be accessed
    after close() has been called. This change ensures that we create a new
    handle after close() is called. This avoids a segfault when the first
    connection attempt fails and then a second connection attempt tries to
    call open() on the already closed DbEnv handle.
    real-or-random authored and furszy committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    5670880 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cba20b9 View commit details
    Browse the repository at this point in the history
  3. Move BerkeleyEnvironment deletion from internal method to callsite

    Instead of having the object destroy itself, having the caller
    destroy it.
    achow101 authored and furszy committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    8e57466 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f4200eb View commit details
    Browse the repository at this point in the history
  5. Add function to close all Db's and reload the databae environment

    Adds a ReloadDbEnv function to BerkeleyEnvironment in order to close all Db
    instances, closes the environment, resets it, and then reopens
    the BerkeleyEnvironment.
    
    Also adds a ReloadDbEnv function to BerkeleyDatabase that calls
    BerkeleyEnvironment's ReloadDbEnv.
    achow101 authored and furszy committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    17ac47e View commit details
    Browse the repository at this point in the history
  6. 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.
    achow101 authored and furszy committed Nov 24, 2021
    Configuration menu
    Copy the full SHA
    64a8a73 View commit details
    Browse the repository at this point in the history

Commits on Nov 25, 2021

  1. No longer shutdown after encrypting the wallet

    Since the database environment is flushed, closed, and reopened during
    EncryptWallet, there is no need to shut down the software anymore.
    
    Adaptation of btc@c1dde3a949b36ce9c2155777b3fa1372e7ed97d8
    furszy committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    6e03bf2 View commit details
    Browse the repository at this point in the history
  2. wallet: Fix duplicate fileid

    ken2812221 authored and furszy committed Nov 25, 2021
    Configuration menu
    Copy the full SHA
    28d17a1 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2021

  1. test: add temp wallet testing setup.

    There are tests, like the ones that uses the wallet encryption, that need access to a real wallet database and not to a mock.
    furszy committed Nov 28, 2021
    Configuration menu
    Copy the full SHA
    c5340ec View commit details
    Browse the repository at this point in the history