From 55f205eba1186d6298353d332a8a268f0493e500 Mon Sep 17 00:00:00 2001 From: UdjinM6 Date: Tue, 8 Jan 2019 13:36:35 +0300 Subject: [PATCH] A couple of fixes for `masternode list` rpc (#2615) * fix payee * add keyidowner/keyidvoting/pubkeyoperator ifields/filter to "json" option * fix whitespaces --- src/rpc/masternode.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/rpc/masternode.cpp b/src/rpc/masternode.cpp index 9f390f841..3190727a6 100644 --- a/src/rpc/masternode.cpp +++ b/src/rpc/masternode.cpp @@ -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;