Skip to content

Commit 6e9b6ee

Browse files
committed
trivial: activemasternode clang-tidy cleanups
1 parent 6f4e17c commit 6e9b6ee

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/activemasternode.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ OperationResult CActiveDeterministicMasternodeManager::SetOperatorKey(const std:
7676
}
7777
info.keyOperator = *opSk;
7878
info.pubKeyOperator = info.keyOperator.GetPublicKey();
79-
return OperationResult(true);
79+
return {true};
8080
}
8181

8282
OperationResult CActiveDeterministicMasternodeManager::GetOperatorKey(CBLSSecretKey& key, CDeterministicMNCPtr& dmn) const
@@ -93,7 +93,7 @@ OperationResult CActiveDeterministicMasternodeManager::GetOperatorKey(CBLSSecret
9393
}
9494
// return key
9595
key = info.keyOperator;
96-
return OperationResult(true);
96+
return {true};
9797
}
9898

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

298-
return OperationResult(true);
298+
return {true};
299299
}
300300

301301
//
@@ -426,7 +426,7 @@ bool CActiveMasternode::SendMasternodePing(std::string& errorMessage)
426426

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

476-
void CActiveMasternode::GetKeys(CKey& _privKeyMasternode, CPubKey& _pubKeyMasternode)
476+
void CActiveMasternode::GetKeys(CKey& _privKeyMasternode, CPubKey& _pubKeyMasternode) const
477477
{
478478
if (!privKeyMasternode.IsValid() || !pubKeyMasternode.IsValid()) {
479479
throw std::runtime_error("Error trying to get masternode keys");

src/activemasternode.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ class CActiveDeterministicMasternodeManager : public CValidationInterface
5252
CActiveMasternodeInfo info;
5353

5454
public:
55-
virtual ~CActiveDeterministicMasternodeManager() = default;
56-
virtual void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload);
55+
~CActiveDeterministicMasternodeManager() override = default;
56+
void UpdatedBlockTip(const CBlockIndex* pindexNew, const CBlockIndex* pindexFork, bool fInitialDownload) override;
5757

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

109-
void GetKeys(CKey& privKeyMasternode, CPubKey& pubKeyMasternode);
109+
void GetKeys(CKey& privKeyMasternode, CPubKey& pubKeyMasternode) const;
110110
};
111111

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

0 commit comments

Comments
 (0)