mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-02-03 20:21:10 +00:00
Merge #16095: Catch by reference not value in wallettool
ae7faf20d5 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 ae7faf20d5fb3e2415ccadc37100dfc44aa0cd94
Tree-SHA512: 07eb774b3296c0b66ac5040269bff6cd8ba0294c8c95cc08c595efbd535260ff0010fa430ca057eeccd7b38c0a981a3d7a95b675d9e2996853c013dc0bfe8127
This commit is contained in:
commit
76e2cded47
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user