Remove support for "masternode list rank"

This commit is contained in:
Alexander Block 2018-12-17 16:02:12 +01:00
parent adc2ec2253
commit 0fe97a0459

View File

@ -816,7 +816,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
strMode != "addr" && strMode != "full" && strMode != "info" && strMode != "json" && strMode != "addr" && strMode != "full" && strMode != "info" && strMode != "json" &&
strMode != "lastpaidtime" && strMode != "lastpaidblock" && strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
strMode != "payee" && strMode != "pubkey" && strMode != "payee" && strMode != "pubkey" &&
strMode != "rank" && strMode != "status")) strMode != "status"))
{ {
masternode_list_help(); masternode_list_help();
} }
@ -831,22 +831,13 @@ UniValue masternodelist(const JSONRPCRequest& request)
} }
UniValue obj(UniValue::VOBJ); UniValue obj(UniValue::VOBJ);
if (strMode == "rank") {
CMasternodeMan::rank_pair_vec_t vMasternodeRanks;
mnodeman.GetMasternodeRanks(vMasternodeRanks);
for (const auto& rankpair : vMasternodeRanks) {
std::string strOutpoint = rankpair.second.outpoint.ToStringShort();
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
obj.push_back(Pair(strOutpoint, rankpair.first));
}
} else {
std::map<COutPoint, CMasternode> mapMasternodes = mnodeman.GetFullMasternodeMap(); std::map<COutPoint, CMasternode> mapMasternodes = mnodeman.GetFullMasternodeMap();
for (const auto& mnpair : mapMasternodes) { for (const auto& mnpair : mapMasternodes) {
CMasternode mn = mnpair.second; CMasternode mn = mnpair.second;
std::string strOutpoint = mnpair.first.ToStringShort(); std::string strOutpoint = mnpair.first.ToStringShort();
CScript payeeScript; CScript payeeScript;
if (deterministicMNManager->IsDIP3Active()) { if (deterministicMNManager->IsDeterministicMNsSporkActive()) {
auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByCollateral(mn.outpoint); auto dmn = deterministicMNManager->GetListAtChainTip().GetMNByCollateral(mn.outpoint);
if (dmn) { if (dmn) {
payeeScript = dmn->pdmnState->scriptPayout; payeeScript = dmn->pdmnState->scriptPayout;
@ -931,7 +922,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
obj.push_back(Pair(strOutpoint, strStatus)); obj.push_back(Pair(strOutpoint, strStatus));
} }
} }
}
return obj; return obj;
} }