Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added votesExcluded to rpc calls that return excludedVotes #951

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/consensus/dao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2585,6 +2585,7 @@ void CConsultation::ToJson(UniValue& ret, const CStateViewCache& view) const
mapState.pushKV(std::to_string(it.second), it.first.ToString());
}
ret.pushKV("excludedVotes", view.GetExcludeVotes());
ret.pushKV("votesExcluded", view.GetExcludeVotes());
ret.pushKV("mapState", mapState);
ret.pushKV("answers", answers);
ret.pushKV("min", nMin);
Expand Down Expand Up @@ -2902,6 +2903,7 @@ void CConsultationAnswer::ToJson(UniValue& ret, const CStateViewCache& view) con
mapState.pushKV(std::to_string(it.second), it.first.ToString());
}
ret.pushKV("excludedVotes", view.GetExcludeVotes());
ret.pushKV("votesExcluded", view.GetExcludeVotes());
ret.pushKV("mapState", mapState);
ret.pushKV("status", GetState(view));
ret.pushKV("state", (uint64_t)fState);
Expand Down Expand Up @@ -3499,6 +3501,7 @@ void CProposal::ToJson(UniValue& ret, CStateViewCache& coins) const {
ret.pushKV("votesYes", nVotesYes);
ret.pushKV("votesAbs", nVotesAbs);
ret.pushKV("votesNo", nVotesNo);
ret.pushKV("votesExcluded", coins.GetExcludeVotes());
ret.pushKV("excludedVotes", coins.GetExcludeVotes());
ret.pushKV("votingCycle", std::min((uint64_t)nVotingCycle, GetConsensusParameter(Consensus::CONSENSUS_PARAM_PROPOSAL_MAX_VOTING_CYCLES, coins)+1));
// votingCycle does not return higher than nCyclesProposalVoting to avoid reader confusion, since votes are not counted anyway when votingCycle > nCyclesProposalVoting
Expand Down Expand Up @@ -3561,6 +3564,7 @@ void CPaymentRequest::ToJson(UniValue& ret, const CStateViewCache& view) const {
ret.pushKV("votesYes", nVotesYes);
ret.pushKV("votesAbs", nVotesAbs);
ret.pushKV("votesNo", nVotesNo);
ret.pushKV("votesExcluded", view.GetExcludeVotes());
ret.pushKV("excludedVotes", view.GetExcludeVotes());
ret.pushKV("votingCycle", std::min((uint64_t)nVotingCycle, GetConsensusParameter(Consensus::CONSENSUS_PARAM_PAYMENT_REQUEST_MAX_VOTING_CYCLES, view)+1));
// votingCycle does not return higher than nCyclesPaymentRequestVoting to avoid reader confusion, since votes are not counted anyway when votingCycle > nCyclesPaymentRequestVoting
Expand Down