Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Compilation] Pass caught exceptions by reference #979

Merged
merged 3 commits into from
Sep 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ bool CActiveMasternode::CreateBroadcast(std::string strService, std::string strK

bool CActiveMasternode::CreateBroadcast(CTxIn vin, CService service, CKey keyCollateralAddress, CPubKey pubKeyCollateralAddress, CKey keyMasternode, CPubKey pubKeyMasternode, std::string& errorMessage, CMasternodeBroadcast &mnb)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;

CMasternodePing mnp(vin);
if (!mnp.Sign(keyMasternode, pubKeyMasternode)) {
Expand Down Expand Up @@ -343,8 +343,8 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr

bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secretKey, std::string strTxHash, std::string strOutputIndex)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;

// Find possible candidates
TRY_LOCK(pwalletMain->cs_wallet, fWallet);
Expand Down Expand Up @@ -395,8 +395,8 @@ bool CActiveMasternode::GetMasterNodeVin(CTxIn& vin, CPubKey& pubkey, CKey& secr
// Extract Masternode vin information from output
bool CActiveMasternode::GetVinFromOutput(COutput out, CTxIn& vin, CPubKey& pubkey, CKey& secretKey)
{
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;
// wait for reindex and/or import to finish
if (fImporting || fReindex) return false;

CScript pubScript;

Expand Down
2 changes: 1 addition & 1 deletion src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ class CMainParams : public CChainParams
base58Prefixes[SECRET_KEY] = std::vector<unsigned char>(1, 212);
base58Prefixes[EXT_PUBLIC_KEY] = boost::assign::list_of(0x02)(0x2D)(0x25)(0x33).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = boost::assign::list_of(0x02)(0x21)(0x31)(0x2B).convert_to_container<std::vector<unsigned char> >();
// BIP44 coin type is from https://github.com/satoshilabs/slips/blob/master/slip-0044.md
// BIP44 coin type is from https://github.com/satoshilabs/slips/blob/master/slip-0044.md
base58Prefixes[EXT_COIN_TYPE] = boost::assign::list_of(0x80)(0x00)(0x00)(0x77).convert_to_container<std::vector<unsigned char> >();

convertSeed6(vFixedSeeds, pnSeed6_main, ARRAYLEN(pnSeed6_main));
Expand Down
10 changes: 5 additions & 5 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ bool AppInit2()
try {
boost::filesystem::copy_file(sourceFile, backupFile);
LogPrintf("Creating backup of %s -> %s\n", sourceFile, backupFile);
} catch (boost::filesystem::filesystem_error& error) {
} catch (const boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to create backup %s\n", error.what());
}
#else
Expand Down Expand Up @@ -1152,7 +1152,7 @@ bool AppInit2()
try {
boost::filesystem::remove(file.second);
LogPrintf("Old backup deleted: %s\n", file.second);
} catch (boost::filesystem::filesystem_error& error) {
} catch (const boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to delete backup %s\n", error.what());
}
}
Expand Down Expand Up @@ -1190,7 +1190,7 @@ bool AppInit2()
boost::filesystem::remove_all(zerocoinDir);
LogPrintf("-resync: folder deleted: %s\n", zerocoinDir.string().c_str());
}
} catch (boost::filesystem::filesystem_error& error) {
} catch (const boost::filesystem::filesystem_error& error) {
LogPrintf("Failed to delete blockchain folders %s\n", error.what());
}
}
Expand All @@ -1205,7 +1205,7 @@ bool AppInit2()
try {
boost::filesystem::rename(pathDatabase, pathDatabaseBak);
LogPrintf("Moved old %s to %s. Retrying.\n", pathDatabase.string(), pathDatabaseBak.string());
} catch (boost::filesystem::filesystem_error& error) {
} catch (const boost::filesystem::filesystem_error& error) {
// failure is ok (well, not really, but it's not worse than what we started with)
}

Expand Down Expand Up @@ -1569,7 +1569,7 @@ bool AppInit2()
break;
}
}
} catch (std::exception& e) {
} catch (const std::exception& e) {
if (fDebug) LogPrintf("%s\n", e.what());
strLoadError = _("Error opening block database");
fVerifyingBlocks = false;
Expand Down
Loading