Skip to content

Commit b57740d

Browse files
committed
refactor: drop return bool from AddGovernanceVote which is always true
1 parent 18b7929 commit b57740d

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

src/governance/object.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,7 @@ bool CGovernanceObject::ProcessVote(CMasternodeMetaMan& mn_metaman, CGovernanceM
148148
return false;
149149
}
150150

151-
if (!mn_metaman.AddGovernanceVote(dmn->proTxHash, vote.GetParentHash())) {
152-
std::string msg{strprintf("CGovernanceObject::%s -- Unable to add governance vote, MN outpoint = %s, "
153-
"governance object hash = %s",
154-
__func__, vote.GetMasternodeOutpoint().ToStringShort(), GetHash().ToString())};
155-
LogPrint(BCLog::GOBJECT, "%s\n", msg);
156-
exception = CGovernanceException(msg, GOVERNANCE_EXCEPTION_PERMANENT_ERROR);
157-
return false;
158-
}
151+
mn_metaman.AddGovernanceVote(dmn->proTxHash, vote.GetParentHash());
159152

160153
voteInstanceRef = vote_instance_t(vote.GetOutcome(), nVoteTimeUpdate, vote.GetTimestamp());
161154
fileVotes.AddVote(vote);

src/masternode/meta.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,10 @@ bool CMasternodeMetaMan::IsValidForMixingTxes(const uint256& protx_hash) const
125125
return GetMetaInfoOrDefault(protx_hash).m_mixing_tx_count <= MASTERNODE_MAX_MIXING_TXES;
126126
}
127127

128-
bool CMasternodeMetaMan::AddGovernanceVote(const uint256& proTxHash, const uint256& nGovernanceObjectHash)
128+
void CMasternodeMetaMan::AddGovernanceVote(const uint256& proTxHash, const uint256& nGovernanceObjectHash)
129129
{
130130
LOCK(cs);
131131
GetMetaInfo(proTxHash).AddGovernanceVote(nGovernanceObjectHash);
132-
return true;
133132
}
134133

135134
void CMasternodeMetaMan::RemoveGovernanceObject(const uint256& nGovernanceObjectHash)

src/masternode/meta.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ class CMasternodeMetaMan : public MasternodeMetaStore
209209
void DisallowMixing(const uint256& proTxHash);
210210
bool IsValidForMixingTxes(const uint256& protx_hash) const EXCLUSIVE_LOCKS_REQUIRED(!cs);
211211

212-
bool AddGovernanceVote(const uint256& proTxHash, const uint256& nGovernanceObjectHash);
212+
void AddGovernanceVote(const uint256& proTxHash, const uint256& nGovernanceObjectHash);
213213
void RemoveGovernanceObject(const uint256& nGovernanceObjectHash) EXCLUSIVE_LOCKS_REQUIRED(!cs);
214214

215215
std::vector<uint256> GetAndClearDirtyGovernanceObjectHashes() EXCLUSIVE_LOCKS_REQUIRED(!cs);

0 commit comments

Comments
 (0)