mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-24 13:05:53 +00:00
Don't show our validation key in non-admin server_info.
This commit is contained in:
@@ -1093,7 +1093,7 @@ bool NetworkOPs::recvValidation(const SerializedValidation::pointer& val)
|
||||
return theApp->getValidations().addValidation(val);
|
||||
}
|
||||
|
||||
Json::Value NetworkOPs::getServerInfo()
|
||||
Json::Value NetworkOPs::getServerInfo(bool admin)
|
||||
{
|
||||
Json::Value info = Json::objectValue;
|
||||
|
||||
@@ -1111,8 +1111,13 @@ Json::Value NetworkOPs::getServerInfo()
|
||||
if (mNeedNetworkLedger)
|
||||
info["network_ledger"] = "waiting";
|
||||
|
||||
if (theConfig.VALIDATION_PUB.isValid())
|
||||
info["pubkey_validator"] = theConfig.VALIDATION_PUB.humanNodePublic();
|
||||
if (admin)
|
||||
{
|
||||
if (theConfig.VALIDATION_PUB.isValid())
|
||||
info["pubkey_validator"] = theConfig.VALIDATION_PUB.humanNodePublic();
|
||||
else
|
||||
info["pubkey_validator"] = "none";
|
||||
}
|
||||
info["pubkey_node"] = theApp->getWallet().getNodePublic().humanNodePublic();
|
||||
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ public:
|
||||
int getPreviousConvergeTime() { return mLastCloseConvergeTime; }
|
||||
uint32 getLastCloseTime() { return mLastCloseTime; }
|
||||
void setLastCloseTime(uint32 t) { mLastCloseTime = t; }
|
||||
Json::Value getServerInfo();
|
||||
Json::Value getServerInfo(bool admin);
|
||||
uint32 acceptLedger();
|
||||
boost::unordered_map<uint160,
|
||||
std::list<LedgerProposal::pointer> >& peekStoredProposals() { return mStoredProposals; }
|
||||
|
||||
@@ -1305,7 +1305,7 @@ Json::Value RPCHandler::doServerInfo(Json::Value)
|
||||
{
|
||||
Json::Value ret(Json::objectValue);
|
||||
|
||||
ret["info"] = theApp->getOPs().getServerInfo();
|
||||
ret["info"] = theApp->getOPs().getServerInfo(mRole == ADMIN);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user