Skip to content

Commit 76e2cde

Browse files
author
MarcoFalke
committed
Merge #16095: Catch by reference not value in wallettool
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 #15822. ACKs for commit ae7faf: practicalswift: utACK ae7faf2 Tree-SHA512: 07eb774b3296c0b66ac5040269bff6cd8ba0294c8c95cc08c595efbd535260ff0010fa430ca057eeccd7b38c0a981a3d7a95b675d9e2996853c013dc0bfe8127
2 parents 8ab4f28 + ae7faf2 commit 76e2cde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wallet/wallettool.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ static std::shared_ptr<CWallet> LoadWallet(const std::string& name, const fs::pa
5959
try {
6060
bool first_run;
6161
load_wallet_ret = wallet_instance->LoadWallet(first_run);
62-
} catch (const std::runtime_error) {
62+
} catch (const std::runtime_error&) {
6363
fprintf(stderr, "Error loading %s. Is wallet being used by another process?\n", name.c_str());
6464
return nullptr;
6565
}

0 commit comments

Comments
 (0)