Skip to content

Commit

Permalink
trivial: activemasternode clang-tidy cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
furszy committed Feb 10, 2022
1 parent 6f4e17c commit 6e9b6ee
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions src/activemasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ OperationResult CActiveDeterministicMasternodeManager::SetOperatorKey(const std:
}
info.keyOperator = *opSk;
info.pubKeyOperator = info.keyOperator.GetPublicKey();
return OperationResult(true);
return {true};
}

OperationResult CActiveDeterministicMasternodeManager::GetOperatorKey(CBLSSecretKey& key, CDeterministicMNCPtr& dmn) const
Expand All @@ -93,7 +93,7 @@ OperationResult CActiveDeterministicMasternodeManager::GetOperatorKey(CBLSSecret
}
// return key
key = info.keyOperator;
return OperationResult(true);
return {true};
}

void CActiveDeterministicMasternodeManager::Init(const CBlockIndex* pindexTip)
Expand Down Expand Up @@ -266,7 +266,7 @@ OperationResult initMasternode(const std::string& _strMasterNodePrivKey, const s
return errorOut(strprintf(_("Invalid -masternodeaddr port %d, only %d is supported on %s-net."),
nPort, nDefaultPort, Params().NetworkIDString()));
}
CService addrTest(LookupNumeric(strHost.c_str(), nPort));
CService addrTest(LookupNumeric(strHost, nPort));
if (!addrTest.IsValid()) {
return errorOut(strprintf(_("Invalid -masternodeaddr address: %s"), _strMasterNodeAddr));
}
Expand Down Expand Up @@ -295,7 +295,7 @@ OperationResult initMasternode(const std::string& _strMasterNodePrivKey, const s
if (pmn) activeMasternode.EnableHotColdMasterNode(pmn->vin, pmn->addr);
}

return OperationResult(true);
return {true};
}

//
Expand Down Expand Up @@ -426,7 +426,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage)

// Update lastPing for our masternode in Masternode list
CMasternode* pmn = mnodeman.Find(vin->prevout);
if (pmn != NULL) {
if (pmn != nullptr) {
if (pmn->IsPingedWithin(MasternodePingSeconds(), mnp.sigTime)) {
errorMessage = "Too early to send Masternode Ping";
return false;
Expand Down Expand Up @@ -473,7 +473,7 @@ bool CActiveMasternode::EnableHotColdMasterNode(CTxIn& newVin, CService& newServ
return true;
}

void CActiveMasternode::GetKeys(CKey& _privKeyMasternode, CPubKey& _pubKeyMasternode)
void CActiveMasternode::GetKeys(CKey& _privKeyMasternode, CPubKey& _pubKeyMasternode) const
{
if (!privKeyMasternode.IsValid() || !pubKeyMasternode.IsValid()) {
throw std::runtime_error("Error trying to get masternode keys");
Expand Down
6 changes: 3 additions & 3 deletions src/activemasternode.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ class CActiveDeterministicMasternodeManager : public CValidationInterface
CActiveMasternodeInfo info;

public:
virtual ~CActiveDeterministicMasternodeManager() = default;
virtual void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload);
~CActiveDeterministicMasternodeManager() override = default;
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override;

void Init(const CBlockIndex* pindexTip);
void Reset(masternode_state_t _state, const CBlockIndex* pindexTip);
Expand Down Expand Up @@ -106,7 +106,7 @@ class CActiveMasternode
/// Enable cold wallet mode (run a Masternode with no funds)
bool EnableHotColdMasterNode(CTxIn& vin, CService& addr);

void GetKeys(CKey& privKeyMasternode, CPubKey& pubKeyMasternode);
void GetKeys(CKey& privKeyMasternode, CPubKey& pubKeyMasternode) const;
};

// Compatibility code: get vin and keys for either legacy or deterministic masternode
Expand Down

0 comments on commit 6e9b6ee

Please sign in to comment.