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

Include rank in "masternodelist full" #754

Closed
wants to merge 1 commit into from
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
10 changes: 6 additions & 4 deletions src/rpcmasternode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
" activeseconds - Print number of seconds masternode recognized by the network as enabled\n"
" (since latest issued \"masternode start/start-many/start-alias\")\n"
" addr - Print ip address associated with a masternode (can be additionally filtered, partial match)\n"
" full - Print info in format 'status protocol pubkey IP lastseen activeseconds lastpaid'\n"
" full - Print info in format 'status protocol pubkey IP lastseen activeseconds lastpaid rank'\n"
" (can be additionally filtered, partial match)\n"
" lastseen - Print timestamp of when a masternode was last seen on the network\n"
" lastpaid - The last time a node was paid on the network\n"
Expand All @@ -555,8 +555,9 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
obj.push_back(Pair(strVin, s.first));
}
} else {
std::vector<CMasternode> vMasternodes = mnodeman.GetFullMasternodeVector();
BOOST_FOREACH(CMasternode& mn, vMasternodes) {
std::vector<pair<int, CMasternode> > vMasternodeRanks = mnodeman.GetMasternodeRanks(chainActive.Tip()->nHeight);
BOOST_FOREACH(PAIRTYPE(int, CMasternode) &mn_pair, vMasternodeRanks) {
CMasternode mn = mn_pair.second;
std::string strVin = mn.vin.prevout.ToStringShort();
if (strMode == "activeseconds") {
if(strFilter !="" && strVin.find(strFilter) == string::npos) continue;
Expand All @@ -577,7 +578,8 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
mn.addr.ToString() << " " <<
(int64_t)mn.lastPing.sigTime << " " << setw(8) <<
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
(int64_t)mn.GetLastPaid();
(int64_t)mn.GetLastPaid() << " " <<
mn_pair.first;
std::string output = stringStream.str();
stringStream << " " << strVin;
if(strFilter !="" && stringStream.str().find(strFilter) == string::npos &&
Expand Down