Skip to content

Commit

Permalink
Merge bitcoin#16095: Catch by reference not value in wallettool
Browse files Browse the repository at this point in the history
ae7faf2 Exceptions should be caught by reference, not by value. (Kristaps Kaupe)

Pull request description:

  Fixes this warning with GCC8/GCC9:
  ```
  wallet/wallettool.cpp: In function ‘std::shared_ptr<CWallet> WalletTool::LoadWallet(const string&, const boost::filesystem::path&)’:
  wallet/wallettool.cpp:62:25: warning: catching polymorphic type ‘const class std::runtime_error’ by value [-Wcatch-value=]
       } catch (const std::runtime_error) {
                           ^~~~~~~~~~~~~
  ```
  Related to bitcoin#15822.

ACKs for commit ae7faf:
  practicalswift:
    utACK ae7faf2

Tree-SHA512: 07eb774b3296c0b66ac5040269bff6cd8ba0294c8c95cc08c595efbd535260ff0010fa430ca057eeccd7b38c0a981a3d7a95b675d9e2996853c013dc0bfe8127
  • Loading branch information
MarcoFalke committed May 27, 2019
2 parents 8ab4f28 + ae7faf2 commit 76e2cde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wallet/wallettool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static std::shared_ptr<CWallet> LoadWallet(const std::string& name, const fs::pa
try {
bool first_run;
load_wallet_ret = wallet_instance->LoadWallet(first_run);
} catch (const std::runtime_error) {
} catch (const std::runtime_error&) {
fprintf(stderr, "Error loading %s. Is wallet being used by another process?\n", name.c_str());
return nullptr;
}
Expand Down

0 comments on commit 76e2cde

Please sign in to comment.