Skip to content

Commit adc2ec2

Browse files
committed
Remove unsupported types/fields from "masternode list"
1 parent 4b150e7 commit adc2ec2

File tree

1 file changed

+9
-55
lines changed

1 file changed

+9
-55
lines changed

src/rpc/masternode.cpp

+9-55
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,20 @@ void masternode_list_help()
136136
"2. \"filter\" (string, optional) Filter results. Partial match by outpoint by default in all modes,\n"
137137
" additional matches in some modes are also available\n"
138138
"\nAvailable modes:\n"
139-
" activeseconds - Print number of seconds masternode recognized by the network as enabled\n"
140-
" (since latest issued \"masternode start/start-many/start-alias\")\n"
141139
" addr - Print ip address associated with a masternode (can be additionally filtered, partial match)\n"
142-
" daemon - Print daemon version of a masternode (can be additionally filtered, exact match)\n"
143-
" full - Print info in format 'status protocol payee lastseen activeseconds lastpaidtime lastpaidblock IP'\n"
140+
" full - Print info in format 'status payee lastpaidtime lastpaidblock IP'\n"
144141
" (can be additionally filtered, partial match)\n"
145-
" info - Print info in format 'status protocol payee lastseen activeseconds sentinelversion sentinelstate IP'\n"
142+
" info - Print info in format 'status payee IP'\n"
146143
" (can be additionally filtered, partial match)\n"
147144
" json - Print info in JSON format (can be additionally filtered, partial match)\n"
148145
" lastpaidblock - Print the last block height a node was paid on the network\n"
149146
" lastpaidtime - Print the last time a node was paid on the network\n"
150-
" lastseen - Print timestamp of when a masternode was last seen on the network\n"
151147
" payee - Print Dash address associated with a masternode (can be additionally filtered,\n"
152148
" partial match)\n"
153-
" protocol - Print protocol of a masternode (can be additionally filtered, exact match)\n"
154149
" keyid - Print the masternode (not collateral) key id\n"
155150
" rank - Print rank of a masternode based on current block\n"
156-
" sentinel - Print sentinel version of a masternode (can be additionally filtered, exact match)\n"
157-
" status - Print masternode status: PRE_ENABLED / ENABLED / EXPIRED / SENTINEL_PING_EXPIRED / NEW_START_REQUIRED /\n"
158-
" UPDATE_REQUIRED / POSE_BAN / OUTPOINT_SPENT (can be additionally filtered, partial match)\n"
151+
" status - Print masternode status: ENABED / POSE_BAN / OUTPOINT_SPENT\n"
152+
" (can be additionally filtered, partial match)\n"
159153
);
160154
}
161155

@@ -819,10 +813,10 @@ UniValue masternodelist(const JSONRPCRequest& request)
819813
if (request.params.size() == 2) strFilter = request.params[1].get_str();
820814

821815
if (request.fHelp || (
822-
strMode != "activeseconds" && strMode != "addr" && strMode != "daemon" && strMode != "full" && strMode != "info" && strMode != "json" &&
823-
strMode != "lastseen" && strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
824-
strMode != "protocol" && strMode != "payee" && strMode != "pubkey" &&
825-
strMode != "rank" && strMode != "sentinel" && strMode != "status"))
816+
strMode != "addr" && strMode != "full" && strMode != "info" && strMode != "json" &&
817+
strMode != "lastpaidtime" && strMode != "lastpaidblock" &&
818+
strMode != "payee" && strMode != "pubkey" &&
819+
strMode != "rank" && strMode != "status"))
826820
{
827821
masternode_list_help();
828822
}
@@ -867,32 +861,16 @@ UniValue masternodelist(const JSONRPCRequest& request)
867861
payeeStr = CBitcoinAddress(payeeDest).ToString();
868862
}
869863

870-
if (strMode == "activeseconds") {
871-
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
872-
obj.push_back(Pair(strOutpoint, (int64_t)(mn.lastPing.sigTime - mn.sigTime)));
873-
} else if (strMode == "addr") {
864+
if (strMode == "addr") {
874865
std::string strAddress = mn.addr.ToString();
875866
if (strFilter !="" && strAddress.find(strFilter) == std::string::npos &&
876867
strOutpoint.find(strFilter) == std::string::npos) continue;
877868
obj.push_back(Pair(strOutpoint, strAddress));
878-
} else if (strMode == "daemon") {
879-
std::string strDaemon = mn.lastPing.GetDaemonString();
880-
if (strFilter !="" && strDaemon.find(strFilter) == std::string::npos &&
881-
strOutpoint.find(strFilter) == std::string::npos) continue;
882-
obj.push_back(Pair(strOutpoint, strDaemon));
883-
} else if (strMode == "sentinel") {
884-
std::string strSentinel = mn.lastPing.GetSentinelString();
885-
if (strFilter !="" && strSentinel.find(strFilter) == std::string::npos &&
886-
strOutpoint.find(strFilter) == std::string::npos) continue;
887-
obj.push_back(Pair(strOutpoint, strSentinel));
888869
} else if (strMode == "full") {
889870
std::ostringstream streamFull;
890871
streamFull << std::setw(18) <<
891872
mn.GetStatus() << " " <<
892-
mn.nProtocolVersion << " " <<
893873
payeeStr << " " <<
894-
(int64_t)mn.lastPing.sigTime << " " << std::setw(8) <<
895-
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " << std::setw(10) <<
896874
mn.GetLastPaidTime() << " " << std::setw(6) <<
897875
mn.GetLastPaidBlock() << " " <<
898876
mn.addr.ToString();
@@ -904,12 +882,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
904882
std::ostringstream streamInfo;
905883
streamInfo << std::setw(18) <<
906884
mn.GetStatus() << " " <<
907-
mn.nProtocolVersion << " " <<
908885
payeeStr << " " <<
909-
(int64_t)mn.lastPing.sigTime << " " << std::setw(8) <<
910-
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
911-
mn.lastPing.GetSentinelString() << " " <<
912-
(mn.lastPing.fSentinelIsCurrent ? "current" : "expired") << " " <<
913886
mn.addr.ToString();
914887
std::string strInfo = streamInfo.str();
915888
if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&
@@ -920,12 +893,6 @@ UniValue masternodelist(const JSONRPCRequest& request)
920893
streamInfo << mn.addr.ToString() << " " <<
921894
CBitcoinAddress(mn.pubKeyCollateralAddress.GetID()).ToString() << " " <<
922895
mn.GetStatus() << " " <<
923-
mn.nProtocolVersion << " " <<
924-
mn.lastPing.nDaemonVersion << " " <<
925-
mn.lastPing.GetSentinelString() << " " <<
926-
(mn.lastPing.fSentinelIsCurrent ? "current" : "expired") << " " <<
927-
(int64_t)mn.lastPing.sigTime << " " <<
928-
(int64_t)(mn.lastPing.sigTime - mn.sigTime) << " " <<
929896
mn.GetLastPaidTime() << " " <<
930897
mn.GetLastPaidBlock();
931898
std::string strInfo = streamInfo.str();
@@ -935,12 +902,6 @@ UniValue masternodelist(const JSONRPCRequest& request)
935902
objMN.push_back(Pair("address", mn.addr.ToString()));
936903
objMN.push_back(Pair("payee", CBitcoinAddress(mn.pubKeyCollateralAddress.GetID()).ToString()));
937904
objMN.push_back(Pair("status", mn.GetStatus()));
938-
objMN.push_back(Pair("protocol", mn.nProtocolVersion));
939-
objMN.push_back(Pair("daemonversion", mn.lastPing.GetDaemonString()));
940-
objMN.push_back(Pair("sentinelversion", mn.lastPing.GetSentinelString()));
941-
objMN.push_back(Pair("sentinelstate", (mn.lastPing.fSentinelIsCurrent ? "current" : "expired")));
942-
objMN.push_back(Pair("lastseen", (int64_t)mn.lastPing.sigTime));
943-
objMN.push_back(Pair("activeseconds", (int64_t)(mn.lastPing.sigTime - mn.sigTime)));
944905
objMN.push_back(Pair("lastpaidtime", mn.GetLastPaidTime()));
945906
objMN.push_back(Pair("lastpaidblock", mn.GetLastPaidBlock()));
946907
obj.push_back(Pair(strOutpoint, objMN));
@@ -950,17 +911,10 @@ UniValue masternodelist(const JSONRPCRequest& request)
950911
} else if (strMode == "lastpaidtime") {
951912
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
952913
obj.push_back(Pair(strOutpoint, mn.GetLastPaidTime()));
953-
} else if (strMode == "lastseen") {
954-
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
955-
obj.push_back(Pair(strOutpoint, (int64_t)mn.lastPing.sigTime));
956914
} else if (strMode == "payee") {
957915
if (strFilter !="" && payeeStr.find(strFilter) == std::string::npos &&
958916
strOutpoint.find(strFilter) == std::string::npos) continue;
959917
obj.push_back(Pair(strOutpoint, payeeStr));
960-
} else if (strMode == "protocol") {
961-
if (strFilter !="" && strFilter != strprintf("%d", mn.nProtocolVersion) &&
962-
strOutpoint.find(strFilter) == std::string::npos) continue;
963-
obj.push_back(Pair(strOutpoint, mn.nProtocolVersion));
964918
} else if (strMode == "keyIDOwner") {
965919
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) continue;
966920
obj.push_back(Pair(strOutpoint, HexStr(mn.keyIDOwner)));

0 commit comments

Comments
 (0)