mirror of
https://github.com/XRPLF/rippled.git
synced 2026-06-03 16:56:48 +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;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#include "../json/value.h"
|
||||
|
||||
#include "NewcoinAddress.h"
|
||||
#include "Serializer.h"
|
||||
|
||||
@@ -48,6 +50,7 @@ public:
|
||||
std::vector<unsigned char> sign();
|
||||
|
||||
void changePosition(const uint256& newPosition, uint32 newCloseTime);
|
||||
Json::Value getJson() const;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user