mirror of
https://github.com/dashpay/dash.git
synced 2024-12-25 03:52:49 +01:00
refactor: add more consts everywhere as required by cppcheck 2.13.0
This commit is contained in:
parent
61a6c407fe
commit
add99ea862
@ -220,7 +220,7 @@ bool CActiveMasternodeManager::GetLocalAddress(CService& addrRet)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CActiveMasternodeManager::IsValidNetAddr(CService addrIn)
|
||||
bool CActiveMasternodeManager::IsValidNetAddr(const CService& addrIn)
|
||||
{
|
||||
// TODO: regtest is fine with any addresses for now,
|
||||
// should probably be a bit smarter if one day we start to implement tests for this
|
||||
|
@ -61,7 +61,7 @@ public:
|
||||
std::string GetStateString() const;
|
||||
std::string GetStatus() const;
|
||||
|
||||
static bool IsValidNetAddr(CService addrIn);
|
||||
static bool IsValidNetAddr(const CService& addrIn);
|
||||
|
||||
private:
|
||||
bool GetLocalAddress(CService& addrRet);
|
||||
|
@ -76,7 +76,7 @@ void CMasternodeSync::SwitchToNextAsset()
|
||||
nCurrentAsset = MASTERNODE_SYNC_FINISHED;
|
||||
uiInterface.NotifyAdditionalDataSyncProgressChanged(1);
|
||||
|
||||
connman.ForEachNode(CConnman::AllNodes, [](CNode* pnode) {
|
||||
connman.ForEachNode(CConnman::AllNodes, [](const CNode* pnode) {
|
||||
netfulfilledman->AddFulfilledRequest(pnode->addr, "full-sync");
|
||||
});
|
||||
LogPrintf("CMasternodeSync::SwitchToNextAsset -- Sync has finished\n");
|
||||
@ -260,7 +260,7 @@ void CMasternodeSync::ProcessTick()
|
||||
}
|
||||
|
||||
// request votes on per-obj basis from each node
|
||||
for (auto& pnode : vNodesCopy) {
|
||||
for (const auto& pnode : vNodesCopy) {
|
||||
if(!netfulfilledman->HasFulfilledRequest(pnode->addr, "governance-sync")) {
|
||||
continue; // to early for this node
|
||||
}
|
||||
|
@ -1262,22 +1262,22 @@ static void protx_list_help(const JSONRPCRequest& request)
|
||||
}
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
static bool CheckWalletOwnsKey(CWallet* pwallet, const CKeyID& keyID) {
|
||||
static bool CheckWalletOwnsKey(const CWallet* const pwallet, const CKeyID& keyID) {
|
||||
if (!pwallet) {
|
||||
return false;
|
||||
}
|
||||
LegacyScriptPubKeyMan* spk_man = pwallet->GetLegacyScriptPubKeyMan();
|
||||
const LegacyScriptPubKeyMan* const spk_man = pwallet->GetLegacyScriptPubKeyMan();
|
||||
if (!spk_man) {
|
||||
return false;
|
||||
}
|
||||
return spk_man->HaveKey(keyID);
|
||||
}
|
||||
|
||||
static bool CheckWalletOwnsScript(CWallet* pwallet, const CScript& script) {
|
||||
static bool CheckWalletOwnsScript(const CWallet* const pwallet, const CScript& script) {
|
||||
if (!pwallet) {
|
||||
return false;
|
||||
}
|
||||
LegacyScriptPubKeyMan* spk_man = pwallet->GetLegacyScriptPubKeyMan();
|
||||
const LegacyScriptPubKeyMan* const spk_man = pwallet->GetLegacyScriptPubKeyMan();
|
||||
if (!spk_man) {
|
||||
return false;
|
||||
}
|
||||
@ -1292,7 +1292,7 @@ static bool CheckWalletOwnsScript(CWallet* pwallet, const CScript& script) {
|
||||
}
|
||||
#endif
|
||||
|
||||
static UniValue BuildDMNListEntry(CWallet* pwallet, const CDeterministicMN& dmn, CMasternodeMetaMan& mn_metaman, bool detailed, const ChainstateManager& chainman, const CBlockIndex* pindex = nullptr)
|
||||
static UniValue BuildDMNListEntry(const CWallet* const pwallet, const CDeterministicMN& dmn, CMasternodeMetaMan& mn_metaman, bool detailed, const ChainstateManager& chainman, const CBlockIndex* pindex = nullptr)
|
||||
{
|
||||
if (!detailed) {
|
||||
return dmn.proTxHash.ToString();
|
||||
|
@ -602,8 +602,8 @@ static UniValue masternodelist(const JSONRPCRequest& request, ChainstateManager&
|
||||
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
|
||||
auto mnList = node.dmnman->GetListAtChainTip();
|
||||
auto dmnToStatus = [&](auto& dmn) {
|
||||
const auto mnList = node.dmnman->GetListAtChainTip();
|
||||
const auto dmnToStatus = [&](const auto& dmn) {
|
||||
if (mnList.IsMNValid(dmn)) {
|
||||
return "ENABLED";
|
||||
}
|
||||
@ -612,7 +612,7 @@ static UniValue masternodelist(const JSONRPCRequest& request, ChainstateManager&
|
||||
}
|
||||
return "UNKNOWN";
|
||||
};
|
||||
auto dmnToLastPaidTime = [&](auto& dmn) {
|
||||
const auto dmnToLastPaidTime = [&](const auto& dmn) {
|
||||
if (dmn.pdmnState->nLastPaidHeight == 0) {
|
||||
return (int)0;
|
||||
}
|
||||
@ -622,9 +622,9 @@ static UniValue masternodelist(const JSONRPCRequest& request, ChainstateManager&
|
||||
return (int)pindex->nTime;
|
||||
};
|
||||
|
||||
bool showRecentMnsOnly = strMode == "recent";
|
||||
bool showEvoOnly = strMode == "evo";
|
||||
int tipHeight = WITH_LOCK(cs_main, return chainman.ActiveChain().Tip()->nHeight);
|
||||
const bool showRecentMnsOnly = strMode == "recent";
|
||||
const bool showEvoOnly = strMode == "evo";
|
||||
const int tipHeight = WITH_LOCK(cs_main, return chainman.ActiveChain().Tip()->nHeight);
|
||||
mnList.ForEachMN(false, [&](auto& dmn) {
|
||||
if (showRecentMnsOnly && mnList.IsMNPoSeBanned(dmn)) {
|
||||
if (tipHeight - dmn.pdmnState->GetBannedHeight() > Params().GetConsensus().nSuperblockCycle) {
|
||||
|
@ -61,7 +61,7 @@ class StatsdClient {
|
||||
static void cleanup(std::string& key);
|
||||
|
||||
protected:
|
||||
std::unique_ptr<struct _StatsdClientData> d;
|
||||
const std::unique_ptr<struct _StatsdClientData> d;
|
||||
};
|
||||
|
||||
} // namespace statsd
|
||||
|
Loading…
Reference in New Issue
Block a user