Skip to content

Commit 35f079c

Browse files
PastaPastaPastaUdjinM6
authored andcommitted
Remove unused code (#3097)
* remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code, maybe need to revert / change the surrounding values Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * remove unused code Signed-off-by: Pasta <pasta@dashboost.org> * Revert "remove unused code" This reverts commit 8ea0bbb.
1 parent b12cd5f commit 35f079c

21 files changed

+0
-170
lines changed

src/evo/deterministicmns.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,6 @@ CDeterministicMNCPtr CDeterministicMNList::GetMNByService(const CService& servic
173173
return GetUniquePropertyMN(service);
174174
}
175175

176-
CDeterministicMNCPtr CDeterministicMNList::GetValidMNByService(const CService& service) const
177-
{
178-
auto dmn = GetUniquePropertyMN(service);
179-
if (dmn && !IsMNValid(dmn)) {
180-
return nullptr;
181-
}
182-
return dmn;
183-
}
184-
185176
CDeterministicMNCPtr CDeterministicMNList::GetMNByInternalId(uint64_t internalId) const
186177
{
187178
auto proTxHash = mnInternalIdMap.find(internalId);

src/evo/deterministicmns.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ class CDeterministicMN
230230
std::string ToString() const;
231231
void ToJson(UniValue& obj) const;
232232
};
233-
typedef std::shared_ptr<CDeterministicMN> CDeterministicMNPtr;
234233
typedef std::shared_ptr<const CDeterministicMN> CDeterministicMNCPtr;
235234

236235
class CDeterministicMNListDiff;
@@ -392,10 +391,6 @@ class CDeterministicMNList
392391
{
393392
return GetMN(proTxHash) != nullptr;
394393
}
395-
bool HasValidMN(const uint256& proTxHash) const
396-
{
397-
return GetValidMN(proTxHash) != nullptr;
398-
}
399394
bool HasMNByCollateral(const COutPoint& collateralOutpoint) const
400395
{
401396
return GetMNByCollateral(collateralOutpoint) != nullptr;
@@ -410,7 +405,6 @@ class CDeterministicMNList
410405
CDeterministicMNCPtr GetMNByCollateral(const COutPoint& collateralOutpoint) const;
411406
CDeterministicMNCPtr GetValidMNByCollateral(const COutPoint& collateralOutpoint) const;
412407
CDeterministicMNCPtr GetMNByService(const CService& service) const;
413-
CDeterministicMNCPtr GetValidMNByService(const CService& service) const;
414408
CDeterministicMNCPtr GetMNByInternalId(uint64_t internalId) const;
415409
CDeterministicMNCPtr GetMNPayee() const;
416410

src/governance/governance-classes.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,6 @@ class CSuperblock : public CGovernanceObject
150150
int GetStatus() { return nStatus; }
151151
void SetStatus(int nStatusIn) { nStatus = nStatusIn; }
152152

153-
// IS THIS TRIGGER ALREADY EXECUTED?
154-
bool IsExecuted() { return nStatus == SEEN_OBJECT_EXECUTED; }
155153
// TELL THE ENGINE WE EXECUTED THIS EVENT
156154
void SetExecuted() { nStatus = SEEN_OBJECT_EXECUTED; }
157155

src/governance/governance-object.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -275,19 +275,6 @@ std::set<uint256> CGovernanceObject::RemoveInvalidVotes(const COutPoint& mnOutpo
275275
return removedVotes;
276276
}
277277

278-
std::string CGovernanceObject::GetSignatureMessage() const
279-
{
280-
LOCK(cs);
281-
std::string strMessage = nHashParent.ToString() + "|" +
282-
std::to_string(nRevision) + "|" +
283-
std::to_string(nTime) + "|" +
284-
GetDataAsHexString() + "|" +
285-
masternodeOutpoint.ToStringShort() + "|" +
286-
nCollateralHash.ToString();
287-
288-
return strMessage;
289-
}
290-
291278
uint256 CGovernanceObject::GetHash() const
292279
{
293280
// Note: doesn't match serialization

src/governance/governance-object.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ static const int64_t GOVERNANCE_ORPHAN_EXPIRATION_TIME = 10 * 60;
4444
// FOR SEEN MAP ARRAYS - GOVERNANCE OBJECTS AND VOTES
4545
static const int SEEN_OBJECT_IS_VALID = 0;
4646
static const int SEEN_OBJECT_ERROR_INVALID = 1;
47-
static const int SEEN_OBJECT_ERROR_IMMATURE = 2;
4847
static const int SEEN_OBJECT_EXECUTED = 3; //used for triggers
4948
static const int SEEN_OBJECT_UNKNOWN = 4; // the default
5049

@@ -258,7 +257,6 @@ class CGovernanceObject
258257
bool Sign(const CBLSSecretKey& key);
259258
bool CheckSignature(const CBLSPublicKey& pubKey) const;
260259

261-
std::string GetSignatureMessage() const;
262260
uint256 GetSignatureHash() const;
263261

264262
// CORE OBJECT FUNCTIONS

src/governance/governance-votedb.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ class CGovernanceObjectVoteFile
3737
typedef vote_m_t::const_iterator vote_m_cit;
3838

3939
private:
40-
static const int MAX_MEMORY_VOTES = -1;
41-
4240
int nMemoryVotes;
4341

4442
vote_l_t listVotes;

src/governance/governance.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ class CGovernanceManager
198198

199199
typedef txout_m_t::iterator txout_m_it;
200200

201-
typedef txout_m_t::const_iterator txout_m_cit;
202-
203-
typedef std::map<COutPoint, int> txout_int_m_t;
204-
205201
typedef std::set<uint256> hash_s_t;
206202

207203
typedef hash_s_t::iterator hash_s_it;
@@ -212,14 +208,10 @@ class CGovernanceManager
212208

213209
typedef object_info_m_t::iterator object_info_m_it;
214210

215-
typedef object_info_m_t::const_iterator object_info_m_cit;
216-
217211
typedef std::map<uint256, int64_t> hash_time_m_t;
218212

219213
typedef hash_time_m_t::iterator hash_time_m_it;
220214

221-
typedef hash_time_m_t::const_iterator hash_time_m_cit;
222-
223215
private:
224216
static const int MAX_CACHE_SIZE = 1000000;
225217

@@ -380,10 +372,6 @@ class CGovernanceManager
380372
mapPostponedObjects.insert(std::make_pair(govobj.GetHash(), govobj));
381373
}
382374

383-
void AddSeenGovernanceObject(const uint256& nHash, int status);
384-
385-
void AddSeenVote(const uint256& nHash, int status);
386-
387375
void MasternodeRateUpdate(const CGovernanceObject& govobj);
388376

389377
bool MasternodeRateCheck(const CGovernanceObject& govobj, bool fUpdateFailStatus = false);
@@ -420,11 +408,6 @@ class CGovernanceManager
420408
cmapInvalidVotes.Insert(vote.GetHash(), vote);
421409
}
422410

423-
void AddOrphanVote(const CGovernanceVote& vote)
424-
{
425-
cmmapOrphanVotes.Insert(vote.GetHash(), vote_time_pair_t(vote, GetAdjustedTime() + GOVERNANCE_ORPHAN_EXPIRATION_TIME));
426-
}
427-
428411
bool ProcessVote(CNode* pfrom, const CGovernanceVote& vote, CGovernanceException& exception, CConnman& connman);
429412

430413
/// Called to indicate a requested object has been received

src/llmq/quorums.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,4 @@ CQuorumCPtr CQuorumManager::GetQuorum(Consensus::LLMQType llmqType, const CBlock
410410
return quorum;
411411
}
412412

413-
CQuorumCPtr CQuorumManager::GetNewestQuorum(Consensus::LLMQType llmqType)
414-
{
415-
auto quorums = ScanQuorums(llmqType, 1);
416-
if (quorums.empty()) {
417-
return nullptr;
418-
}
419-
return quorums.front();
420-
}
421-
422413
} // namespace llmq

src/llmq/quorums.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,6 @@ class CQuorumManager
9898

9999
// all these methods will lock cs_main for a short period of time
100100
CQuorumCPtr GetQuorum(Consensus::LLMQType llmqType, const uint256& quorumHash);
101-
CQuorumCPtr GetNewestQuorum(Consensus::LLMQType llmqType);
102101
std::vector<CQuorumCPtr> ScanQuorums(Consensus::LLMQType llmqType, size_t maxCount);
103102

104103
// this one is cs_main-free

src/llmq/quorums_debug.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,14 +176,6 @@ void CDKGDebugManager::InitLocalSessionStatus(Consensus::LLMQType llmqType, cons
176176
session.members.resize((size_t)params.size);
177177
}
178178

179-
void CDKGDebugManager::UpdateLocalStatus(std::function<bool(CDKGDebugStatus& status)>&& func)
180-
{
181-
LOCK(cs);
182-
if (func(localStatus)) {
183-
localStatus.nTime = GetAdjustedTime();
184-
}
185-
}
186-
187179
void CDKGDebugManager::UpdateLocalSessionStatus(Consensus::LLMQType llmqType, std::function<bool(CDKGDebugSessionStatus& status)>&& func)
188180
{
189181
LOCK(cs);

0 commit comments

Comments
 (0)