add masternodelist pubkey
to rpc (#1549)
* add masternodelist pubkey to rpc * add method in alphabetical order
This commit is contained in:
parent
7707c07897
commit
a0851494db
@ -455,7 +455,8 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
|
||||
if (fHelp || (
|
||||
strMode != "activeseconds" && strMode != "addr" && strMode != "full" && strMode != "info" &&
|
||||
strMode != "lastseen" && strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
|
||||
strMode != "protocol" && strMode != "payee" && strMode != "rank" && strMode != "status"))
|
||||
strMode != "protocol" && strMode != "payee" && strMode != "pubkey" &&
|
||||
strMode != "rank" && strMode != "status"))
|
||||
{
|
||||
throw std::runtime_error(
|
||||
"masternodelist ( \"mode\" \"filter\" )\n"
|
||||
@ -478,6 +479,7 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
|
||||
" payee - Print Dash address associated with a masternode (can be additionally filtered,\n"
|
||||
" partial match)\n"
|
||||
" protocol - Print protocol of a masternode (can be additionally filtered, exact match))\n"
|
||||
" pubkey - Print the masternode (not collateral) public key\n"
|
||||
" rank - Print rank of a masternode based on current block\n"
|
||||
" status - Print masternode status: PRE_ENABLED / ENABLED / EXPIRED / WATCHDOG_EXPIRED / NEW_START_REQUIRED /\n"
|
||||
" UPDATE_REQUIRED / POSE_BAN / OUTPOINT_SPENT (can be additionally filtered, partial match)\n"
|
||||
@ -557,6 +559,9 @@ UniValue masternodelist(const UniValue& params, bool fHelp)
|
||||
if (strFilter !="" && strFilter != strprintf("%d", mn.nProtocolVersion) &&
|
||||
strOutpoint.find(strFilter) == std::string::npos) continue;
|
||||
obj.push_back(Pair(strOutpoint, (int64_t)mn.nProtocolVersion));
|
||||
} else if (strMode == "pubkey") {
|
||||
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
|
||||
obj.push_back(Pair(strOutpoint, HexStr(mn.pubKeyMasternode)));
|
||||
} else if (strMode == "status") {
|
||||
std::string strStatus = mn.GetStatus();
|
||||
if (strFilter !="" && strStatus.find(strFilter) == std::string::npos &&
|
||||
|
Loading…
Reference in New Issue
Block a user