mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Add more consensus information to the "server_info" RPC call.
This commit is contained in:
@@ -960,6 +960,25 @@ void LedgerConsensus::endConsensus()
|
||||
Json::Value LedgerConsensus::getJson()
|
||||
{
|
||||
Json::Value ret(Json::objectValue);
|
||||
ret["proposing"] = mProposing ? "yes" : "no";
|
||||
ret["validating"] = mValidating ? "yes" : "no";
|
||||
ret["synched"] = mHaveCorrectLCL ? "yes" : "no";
|
||||
ret["proposers"] = static_cast<int>(mPeerPositions.size());
|
||||
|
||||
switch (mState)
|
||||
{
|
||||
case lcsPRE_CLOSE: ret["state"] = "open"; break;
|
||||
case lcsESTABLISH: ret["state"] = "consensus"; break;
|
||||
case lcsFINISHED: ret["state"] = "finished"; break;
|
||||
case lcsACCEPTED: ret["state"] = "accepted"; break;
|
||||
}
|
||||
|
||||
int v = mDisputes.size();
|
||||
if (v != 0)
|
||||
ret["disputes"] = v;
|
||||
|
||||
if (mOurPosition)
|
||||
ret["our_position"] = mOurPosition->getJson();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user