fixed getinfo for 0-vote proposals
This commit is contained in:
parent
6c6a280df8
commit
5b98d9db05
@ -534,7 +534,7 @@ CBudgetProposal *CBudgetManager::FindProposal(const std::string &strProposalName
|
||||
{
|
||||
//find the prop with the highest yes count
|
||||
|
||||
int nYesCount = 0;
|
||||
int nYesCount = -99999;
|
||||
CBudgetProposal* prop = NULL;
|
||||
|
||||
std::map<uint256, CBudgetProposal>::iterator it = mapProposals.begin();
|
||||
@ -546,7 +546,7 @@ CBudgetProposal *CBudgetManager::FindProposal(const std::string &strProposalName
|
||||
++it;
|
||||
}
|
||||
|
||||
if(nYesCount == 0) return NULL;
|
||||
if(nYesCount == -99999) return NULL;
|
||||
|
||||
return prop;
|
||||
}
|
||||
|
@ -332,6 +332,7 @@ Value mnbudget(const Array& params, bool fHelp)
|
||||
CBitcoinAddress address2(address1);
|
||||
|
||||
Object obj;
|
||||
obj.push_back(Pair("VoteCommand", prop->GetVoteCommand().c_str()));
|
||||
obj.push_back(Pair("Name", prop->GetName().c_str()));
|
||||
obj.push_back(Pair("Hash", prop->GetHash().ToString().c_str()));
|
||||
obj.push_back(Pair("URL", prop->GetURL().c_str()));
|
||||
@ -346,6 +347,15 @@ Value mnbudget(const Array& params, bool fHelp)
|
||||
obj.push_back(Pair("Abstains", (int64_t)prop->GetAbstains()));
|
||||
obj.push_back(Pair("Alloted", (int64_t)prop->GetAllotted()));
|
||||
|
||||
std::string strError = "";
|
||||
obj.push_back(Pair("IsValid", prop->IsValid(strError)));
|
||||
obj.push_back(Pair("Owner", prop->vin.prevout.ToStringShort().c_str()));
|
||||
|
||||
if(mapSeenMasternodeBudgetProposals.count(prop->GetHash())) {
|
||||
obj.push_back(Pair("SignatureValid", mapSeenMasternodeBudgetProposals[prop->GetHash()].SignatureValid()));
|
||||
}
|
||||
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user