Add == and != operators to CDeterministicMNState

This commit is contained in:
UdjinM6 2019-10-24 20:05:03 +03:00
parent 8845d4f7d8
commit fba4687581

View File

@ -112,6 +112,28 @@ public:
public:
std::string ToString() const;
void ToJson(UniValue& obj) const;
friend bool operator==(const CDeterministicMNState& a, const CDeterministicMNState& b)
{
return a.nRegisteredHeight == b.nRegisteredHeight
&& a.nLastPaidHeight == b.nLastPaidHeight
&& a.nPoSePenalty == b.nPoSePenalty
&& a.nPoSeRevivedHeight == b.nPoSeRevivedHeight
&& a.nPoSeBanHeight == b.nPoSeBanHeight
&& a.nRevocationReason == b.nRevocationReason
&& a.confirmedHash == b.confirmedHash
&& a.confirmedHashWithProRegTxHash == b.confirmedHashWithProRegTxHash
&& a.keyIDOwner == b.keyIDOwner
&& a.pubKeyOperator == b.pubKeyOperator
&& a.keyIDVoting == b.keyIDVoting
&& a.addr == b.addr
&& a.scriptPayout == b.scriptPayout
&& a.scriptOperatorPayout == b.scriptOperatorPayout;
}
friend bool operator!=(const CDeterministicMNState& a, const CDeterministicMNState& b)
{
return !(a == b);
}
};
typedef std::shared_ptr<CDeterministicMNState> CDeterministicMNStatePtr;
typedef std::shared_ptr<const CDeterministicMNState> CDeterministicMNStateCPtr;