Skip to content

Commit

Permalink
Merge #20324: wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase
Browse files Browse the repository at this point in the history
faf5fa7 wallet: Set DatabaseStatus::SUCCESS in MakeSQLiteDatabase (MarcoFalke)

Pull request description:

  This is a refactor to set the status to `SUCCESS` (like it is done in `MakeBerkeleyDatabase`, too). It also happens to fix a false positive valgrind warning (tested with bionic-gcc and focal-clang):

  ```
   node1 stderr ==28149== Conditional jump or move depends on uninitialised value(s)
  ==28149==    at 0x464471: LoadWallets(interfaces::Chain&) (load.cpp:105)
  ==28149==    by 0x44BFBA: interfaces::(anonymous namespace)::WalletClientImpl::load() (wallet.cpp:510)
  ==28149==    by 0x1640F9: AppInitMain(util::Ref const&, NodeContext&, interfaces::BlockAndHeaderTipInfo*) (init.cpp:1815)
  ==28149==    by 0x144F3F: AppInit (bitcoind.cpp:142)
  ==28149==    by 0x144F3F: main (bitcoind.cpp:172)
  ==28149==
  {
     <insert_a_suppression_name_here>
     Memcheck:Cond
     fun:_Z11LoadWalletsRN10interfaces5ChainE
     fun:_ZN10interfaces12_GLOBAL__N_116WalletClientImpl4loadEv
     fun:_Z11AppInitMainRKN4util3RefER11NodeContextPN10interfaces21BlockAndHeaderTipInfoE
     fun:AppInit
     fun:main
  }

  TEST                                             | STATUS    | DURATION

  wallet_hd.py --descriptors                       | ✖ Failed  | 69 s
  ```

ACKs for top commit:
  achow101:
    ACK faf5fa7

Tree-SHA512: e8cbac195d05518467f89725d413bdf226d74671eba1c1eb80b3a61d65724af75a1fe93bcb5c608eaa0d54eddce992738bd923e7d83e493f54c3f4c67b66408c
  • Loading branch information
MarcoFalke committed Nov 6, 2020
2 parents f5cdc29 + faf5fa7 commit 65460c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/wallet/sqlite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,7 @@ std::unique_ptr<SQLiteDatabase> MakeSQLiteDatabase(const fs::path& path, const D
status = DatabaseStatus::FAILED_VERIFY;
return nullptr;
}
status = DatabaseStatus::SUCCESS;
return db;
} catch (const std::runtime_error& e) {
status = DatabaseStatus::FAILED_LOAD;
Expand Down

0 comments on commit 65460c2

Please sign in to comment.