Skip to content

Commit

Permalink
remove duplicate declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
alex v committed Nov 30, 2019
1 parent 6c7c471 commit 7a27649
Showing 1 changed file with 0 additions and 69 deletions.
69 changes: 0 additions & 69 deletions src/rpc/blockchain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,75 +892,6 @@ UniValue gettxoutsetinfo(const UniValue& params, bool fHelp)
return ret;
}

UniValue listproposals(const UniValue& params, bool fHelp)
{
if (fHelp)
throw runtime_error(
"listproposals \"filter\"\n"
"\nList the proposals and all the relating data including payment requests and status.\n"
"\nNote passing no argument returns all proposals regardless of state.\n"
"\nArguments:\n"
"\n1. \"filter\" (string, optional) \"accepted\" | \"rejected\" | \"expired\" | \"pending\"\n"
"\nExamples:\n"
+ HelpExampleCli("listproposal", "accepted")
+ HelpExampleRpc("listproposal", "")
);

LOCK(cs_main);

UniValue ret(UniValue::VARR);

bool showAll = true;
bool showAccepted = false;
bool showRejected = false;
bool showExpired = false;
bool showPending = false;
if(params.size() == 1) {
if(params[0].get_str() == "accepted") {
showAccepted = true;
showAll = false;
}
if(params[0].get_str() == "rejected") {
showRejected = true;
showAll = false;
}
if(params[0].get_str() == "expired") {
showAll = false;
showExpired = true;
}
if(params[0].get_str() == "pending") {
showAll = false;
showPending = true;
}
}

CProposalMap mapProposals;

if(pcoinsTip->GetAllProposals(mapProposals))
{
for (CProposalMap::iterator it = mapProposals.begin(); it != mapProposals.end(); it++)
{
CFund::CProposal proposal;
if (!pcoinsTip->GetProposal(it->first, proposal))
continue;

if((showAll && (!proposal.IsExpired(pindexBestHeader->GetBlockTime())
|| proposal.fState == CFund::PENDING_VOTING_PREQ
|| proposal.fState == CFund::PENDING_FUNDS))
|| (showPending && (proposal.fState == CFund::NIL || proposal.fState == CFund::PENDING_VOTING_PREQ
|| proposal.fState == CFund::PENDING_FUNDS))
|| (showAccepted && (proposal.fState == CFund::ACCEPTED || proposal.IsAccepted()))
|| (showRejected && (proposal.fState == CFund::REJECTED || proposal.IsRejected()))
|| (showExpired && proposal.IsExpired(pindexBestHeader->GetBlockTime()))) {
UniValue o(UniValue::VOBJ);
proposal.ToJson(o, *pcoinsTip);
ret.push_back(o);
}
}
}
return ret;
}

UniValue cfundstats(const UniValue& params, bool fHelp)
{

Expand Down

0 comments on commit 7a27649

Please sign in to comment.