From 2c1a17909ea61d4bceb322969add6bafdd2fb70b Mon Sep 17 00:00:00 2001 From: Nathan Marley Date: Thu, 20 Sep 2018 05:41:16 -0700 Subject: [PATCH] cleanup: remove unused vars, includes, functions (#2306) --- src/activemasternode.h | 1 - src/governance-classes.h | 5 ----- src/governance-object.h | 4 ---- src/instantx.cpp | 12 ------------ src/instantx.h | 3 --- src/masternode-payments.h | 1 - src/masternode-sync.cpp | 4 ---- src/masternode-sync.h | 4 ---- src/masternodeconfig.h | 20 -------------------- src/masternodeman.h | 1 - src/rpc/masternode.cpp | 2 -- 11 files changed, 57 deletions(-) diff --git a/src/activemasternode.h b/src/activemasternode.h index c937d57e0..22f761cab 100644 --- a/src/activemasternode.h +++ b/src/activemasternode.h @@ -62,7 +62,6 @@ public: CDeterministicMNCPtr GetDMN() const { return mnListEntry; } - masternode_state_t GetState() const { return state; } std::string GetStateString() const; std::string GetStatus() const; diff --git a/src/governance-classes.h b/src/governance-classes.h index ccd14f793..6584f56c4 100644 --- a/src/governance-classes.h +++ b/src/governance-classes.h @@ -13,13 +13,9 @@ #include "util.h" class CSuperblock; -class CGovernanceTrigger; class CGovernanceTriggerManager; class CSuperblockManager; -static const int TRIGGER_UNKNOWN = -1; -static const int TRIGGER_SUPERBLOCK = 1000; - typedef std::shared_ptr CSuperblock_sptr; // DECLARE GLOBAL VARIABLES FOR GOVERNANCE CLASSES @@ -40,7 +36,6 @@ class CGovernanceTriggerManager private: typedef std::map trigger_m_t; typedef trigger_m_t::iterator trigger_m_it; - typedef trigger_m_t::const_iterator trigger_m_cit; trigger_m_t mapTrigger; diff --git a/src/governance-object.h b/src/governance-object.h index 9aebe35a3..20613bf0a 100644 --- a/src/governance-object.h +++ b/src/governance-object.h @@ -239,10 +239,6 @@ public: return fExpired; } - void InvalidateVoteCache() { - fDirtyCache = true; - } - const CGovernanceObjectVoteFile& GetVoteFile() const { return fileVotes; } diff --git a/src/instantx.cpp b/src/instantx.cpp index 79412272b..fbf30ac66 100644 --- a/src/instantx.cpp +++ b/src/instantx.cpp @@ -777,18 +777,6 @@ bool CInstantSend::GetTxLockVote(const uint256& hash, CTxLockVote& txLockVoteRet return true; } -bool CInstantSend::IsInstantSendReadyToLock(const uint256& txHash) -{ - if(!fEnableInstantSend || GetfLargeWorkForkFound() || GetfLargeWorkInvalidChainFound() || - !sporkManager.IsSporkActive(SPORK_2_INSTANTSEND_ENABLED)) return false; - - LOCK(cs_instantsend); - // There must be a successfully verified lock request - // and all outputs must be locked (i.e. have enough signatures) - std::map::iterator it = mapTxLockCandidates.find(txHash); - return it != mapTxLockCandidates.end() && it->second.IsAllOutPointsReady(); -} - void CInstantSend::Clear() { LOCK(cs_instantsend); diff --git a/src/instantx.h b/src/instantx.h index e3c06af1a..0746f5b4f 100644 --- a/src/instantx.h +++ b/src/instantx.h @@ -36,7 +36,6 @@ static const int INSTANTSEND_LOCK_TIMEOUT_SECONDS = 15; static const int INSTANTSEND_FAILED_TIMEOUT_SECONDS = 60; extern bool fEnableInstantSend; -extern int nInstantSendDepth; extern int nCompleteTXLocks; /** @@ -82,8 +81,6 @@ private: void UpdateLockedTransaction(const CTxLockCandidate& txLockCandidate); bool ResolveConflicts(const CTxLockCandidate& txLockCandidate); - bool IsInstantSendReadyToLock(const uint256 &txHash); - public: mutable CCriticalSection cs_instantsend; diff --git a/src/masternode-payments.h b/src/masternode-payments.h index 59b1a320f..e1e2eb9ee 100644 --- a/src/masternode-payments.h +++ b/src/masternode-payments.h @@ -28,7 +28,6 @@ static const int MIN_MASTERNODE_PAYMENT_PROTO_VERSION_2 = 70210; extern CCriticalSection cs_vecPayees; extern CCriticalSection cs_mapMasternodeBlocks; -extern CCriticalSection cs_mapMasternodePayeeVotes; extern CMasternodePayments mnpayments; diff --git a/src/masternode-sync.cpp b/src/masternode-sync.cpp index 2b45e3301..9ff126715 100644 --- a/src/masternode-sync.cpp +++ b/src/masternode-sync.cpp @@ -3,18 +3,14 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "activemasternode.h" -#include "checkpoints.h" #include "governance.h" #include "validation.h" -#include "masternode.h" #include "masternode-payments.h" #include "masternode-sync.h" #include "masternodeman.h" #include "netfulfilledman.h" #include "netmessagemaker.h" -#include "spork.h" #include "ui_interface.h" -#include "util.h" #include "evo/deterministicmns.h" class CMasternodeSync; diff --git a/src/masternode-sync.h b/src/masternode-sync.h index 8a7464f05..1ae54a6ec 100644 --- a/src/masternode-sync.h +++ b/src/masternode-sync.h @@ -7,8 +7,6 @@ #include "chain.h" #include "net.h" -#include - class CMasternodeSync; static const int MASTERNODE_SYNC_FAILED = -1; @@ -24,8 +22,6 @@ static const int MASTERNODE_SYNC_FINISHED = 999; static const int MASTERNODE_SYNC_TICK_SECONDS = 6; static const int MASTERNODE_SYNC_TIMEOUT_SECONDS = 30; // our blocks are 2.5 minutes so 30 seconds should be fine -static const int MASTERNODE_SYNC_ENOUGH_PEERS = 6; - extern CMasternodeSync masternodeSync; // diff --git a/src/masternodeconfig.h b/src/masternodeconfig.h index 39066cd3b..7d978d9dc 100644 --- a/src/masternodeconfig.h +++ b/src/masternodeconfig.h @@ -36,41 +36,21 @@ public: return alias; } - void setAlias(const std::string& alias) { - this->alias = alias; - } - const std::string& getOutputIndex() const { return outputIndex; } - void setOutputIndex(const std::string& outputIndex) { - this->outputIndex = outputIndex; - } - const std::string& getPrivKey() const { return privKey; } - void setPrivKey(const std::string& privKey) { - this->privKey = privKey; - } - const std::string& getTxHash() const { return txHash; } - void setTxHash(const std::string& txHash) { - this->txHash = txHash; - } - const std::string& getIp() const { return ip; } - - void setIp(const std::string& ip) { - this->ip = ip; - } }; CMasternodeConfig() { diff --git a/src/masternodeman.h b/src/masternodeman.h index 94d102cde..3e7b916f8 100644 --- a/src/masternodeman.h +++ b/src/masternodeman.h @@ -135,7 +135,6 @@ public: /// Ask (source) node for mnb void AskForMN(CNode *pnode, const COutPoint& outpoint, CConnman& connman); - void AskForMnb(CNode *pnode, const uint256 &hash); bool PoSeBan(const COutPoint &outpoint); bool AllowMixing(const COutPoint &outpoint); diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 3aaacc05a..284278e4d 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -621,13 +621,11 @@ UniValue masternode_info(const JSONRPCRequest& request) CTransactionRef tx; uint256 hashBlock; - bool fromMempool = false; auto dmn = deterministicMNManager->GetListAtChainTip().GetMN(proTxHash); if (!dmn) { tx = mempool.get(proTxHash); if (tx) { - fromMempool = true; if (tx->nVersion < 3 || tx->nType != TRANSACTION_PROVIDER_REGISTER) throw JSONRPCError(RPC_INVALID_PARAMETER, "TX is not a ProTx"); CProRegTx tmpProTx;