Updated masternode list full command
@@ -217,9 +217,9 @@ Value masternode(const Array& params, bool fHelp)
strCommand = params[1].get_str().c_str();
}
- if (strCommand != "active" && strCommand != "vin" && strCommand != "pubkey" && strCommand != "lastseen" && strCommand != "activeseconds" && strCommand != "rank" && strCommand != "protocol"){
+ if (strCommand != "active" && strCommand != "vin" && strCommand != "pubkey" && strCommand != "lastseen" && strCommand != "lastpaid" && strCommand != "activeseconds" && strCommand != "rank" && strCommand != "txindex" && strCommand != "full" && strCommand != "protocol"){
throw runtime_error(
- "list supports 'active', 'vin', 'pubkey', 'lastseen', 'activeseconds', 'rank', 'protocol'\n");
+ "list supports 'active', 'vin', 'pubkey', 'lastseen', 'lastpaid', 'activeseconds', 'rank', 'txindex', 'protocol', 'full'\n");
}
Object obj;
@@ -240,12 +240,36 @@ Value masternode(const Array& params, bool fHelp)
obj.push_back(Pair(mn.addr.ToString().c_str(), address2.ToString().c_str()));
} else if (strCommand == "protocol") {
obj.push_back(Pair(mn.addr.ToString().c_str(), (int64_t)mn.protocolVersion));
+ } else if (strCommand == "txindex") {
+ obj.push_back(Pair(mn.addr.ToString().c_str(), (int64_t)mn.vin.prevout.n));
+ } else if (strCommand == "lastpaid") {
+ obj.push_back(Pair(mn.addr.ToString().c_str(), mn.nBlockLastPaid));
} else if (strCommand == "lastseen") {
obj.push_back(Pair(mn.addr.ToString().c_str(), (int64_t)mn.lastTimeSeen));
} else if (strCommand == "activeseconds") {
obj.push_back(Pair(mn.addr.ToString().c_str(), (int64_t)(mn.lastTimeSeen - mn.now)));
} else if (strCommand == "rank") {
obj.push_back(Pair(mn.addr.ToString().c_str(), (int)(GetMasternodeRank(mn, pindexBest->nHeight))));
+ }
+ else if (strCommand == "full") {
+ Object list;
+ list.push_back(Pair("active", (int)mn.IsEnabled()));
+ list.push_back(Pair("vin", mn.vin.prevout.hash.ToString().c_str()));
+ list.push_back(Pair("txindex", (int64_t)mn.vin.prevout.n));
+
+ CScript pubkey;
+ pubkey =GetScriptForDestination(mn.pubkey.GetID());
+ CTxDestination address1;
+ ExtractDestination(pubkey, address1);
+ CBitcoinAddress address2(address1);
+
+ list.push_back(Pair("pubkey", address2.ToString().c_str()));
+ list.push_back(Pair("protocol", (int64_t)mn.protocolVersion));
+ list.push_back(Pair("lastseen", (int64_t)mn.lastTimeSeen));
+ list.push_back(Pair("activeseconds", (int64_t)(mn.lastTimeSeen - mn.now)));
+ list.push_back(Pair("rank", (int)(GetMasternodeRank(mn, pindexBest->nHeight))));
+ list.push_back(Pair("lastpaid", mn.nBlockLastPaid));
+ obj.push_back(Pair(mn.addr.ToString().c_str(), list));
}
}
return obj;
