Skip to content

Commit 8daffe2

Browse files
committed
Merge pull request #6891
ad5aae1 constify missing catch cases (Philip Kaufmann)
2 parents 4764f5d + ad5aae1 commit 8daffe2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/bitcoin-cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static bool AppInitRPC(int argc, char* argv[])
9494
// Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
9595
try {
9696
SelectBaseParams(ChainNameFromCommandLine());
97-
} catch(std::exception &e) {
97+
} catch (const std::exception& e) {
9898
fprintf(stderr, "Error: %s\n", e.what());
9999
return false;
100100
}

src/bitcoin-tx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ static bool AppInitRawTx(int argc, char* argv[])
3737
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
3838
try {
3939
SelectParams(ChainNameFromCommandLine());
40-
} catch(std::exception &e) {
40+
} catch (const std::exception& e) {
4141
fprintf(stderr, "Error: %s\n", e.what());
4242
return false;
4343
}

src/bitcoind.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ bool AppInit(int argc, char* argv[])
109109
// Check for -testnet or -regtest parameter (Params() calls are only valid after this clause)
110110
try {
111111
SelectParams(ChainNameFromCommandLine());
112-
} catch(std::exception &e) {
112+
} catch (const std::exception& e) {
113113
fprintf(stderr, "Error: %s\n", e.what());
114114
return false;
115115
}

src/dbwrapper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class CDBIterator
104104
try {
105105
CDataStream ssKey(slKey.data(), slKey.data() + slKey.size(), SER_DISK, CLIENT_VERSION);
106106
ssKey >> key;
107-
} catch(std::exception &e) {
107+
} catch (const std::exception&) {
108108
return false;
109109
}
110110
return true;
@@ -120,7 +120,7 @@ class CDBIterator
120120
CDataStream ssValue(slValue.data(), slValue.data() + slValue.size(), SER_DISK, CLIENT_VERSION);
121121
ssValue.Xor(*obfuscate_key);
122122
ssValue >> value;
123-
} catch(std::exception &e) {
123+
} catch (const std::exception&) {
124124
return false;
125125
}
126126
return true;

0 commit comments

Comments
 (0)