A couple of fixes for masternode list
rpc (#2615)
* fix payee * add keyidowner/keyidvoting/pubkeyoperator ifields/filter to "json" option * fix whitespaces
This commit is contained in:
parent
fa18d3e102
commit
55f205eba1
@ -549,7 +549,7 @@ UniValue masternodelist(const JSONRPCRequest& request)
|
||||
streamInfo << std::setw(18) <<
|
||||
dmnToStatus(dmn) << " " <<
|
||||
payeeStr << " " <<
|
||||
dmn->pdmnState->addr.ToString();
|
||||
dmn->pdmnState->addr.ToString();
|
||||
std::string strInfo = streamInfo.str();
|
||||
if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&
|
||||
strOutpoint.find(strFilter) == std::string::npos) return;
|
||||
@ -557,19 +557,25 @@ UniValue masternodelist(const JSONRPCRequest& request)
|
||||
} else if (strMode == "json") {
|
||||
std::ostringstream streamInfo;
|
||||
streamInfo << dmn->pdmnState->addr.ToString() << " " <<
|
||||
CBitcoinAddress(dmn->pdmnState->scriptPayout).ToString() << " " <<
|
||||
payeeStr << " " <<
|
||||
dmnToStatus(dmn) << " " <<
|
||||
dmnToLastPaidTime(dmn) << " " <<
|
||||
dmn->pdmnState->nLastPaidHeight;
|
||||
dmn->pdmnState->nLastPaidHeight << " " <<
|
||||
HexStr(dmn->pdmnState->keyIDOwner) << " " <<
|
||||
HexStr(dmn->pdmnState->keyIDVoting) << " " <<
|
||||
dmn->pdmnState->pubKeyOperator.ToString();
|
||||
std::string strInfo = streamInfo.str();
|
||||
if (strFilter !="" && strInfo.find(strFilter) == std::string::npos &&
|
||||
strOutpoint.find(strFilter) == std::string::npos) return;
|
||||
UniValue objMN(UniValue::VOBJ);
|
||||
objMN.push_back(Pair("address", dmn->pdmnState->addr.ToString()));
|
||||
objMN.push_back(Pair("payee", CBitcoinAddress(dmn->pdmnState->scriptPayout).ToString()));
|
||||
objMN.push_back(Pair("payee", payeeStr));
|
||||
objMN.push_back(Pair("status", dmnToStatus(dmn)));
|
||||
objMN.push_back(Pair("lastpaidtime", dmnToLastPaidTime(dmn)));
|
||||
objMN.push_back(Pair("lastpaidblock", dmn->pdmnState->nLastPaidHeight));
|
||||
objMN.push_back(Pair("keyidowner", HexStr(dmn->pdmnState->keyIDOwner)));
|
||||
objMN.push_back(Pair("keyidvoting", HexStr(dmn->pdmnState->keyIDVoting)));
|
||||
objMN.push_back(Pair("pubkeyoperator", dmn->pdmnState->pubKeyOperator.ToString()));
|
||||
obj.push_back(Pair(strOutpoint, objMN));
|
||||
} else if (strMode == "lastpaidblock") {
|
||||
if (strFilter !="" && strOutpoint.find(strFilter) == std::string::npos) return;
|
||||
|
Loading…
Reference in New Issue
Block a user