mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-20 11:05:54 +00:00
WS: Do not announce unvalidated ledgers.
This commit is contained in:
@@ -935,6 +935,10 @@ void NetworkOPs::pubAccountInfo(const NewcoinAddress& naAccountID, const Json::V
|
|||||||
|
|
||||||
void NetworkOPs::pubLedger(Ledger::ref lpAccepted)
|
void NetworkOPs::pubLedger(Ledger::ref lpAccepted)
|
||||||
{
|
{
|
||||||
|
// Don't publish to clients ledgers we don't trust.
|
||||||
|
if (NetworkOPs::omDISCONNECTED == getOperatingMode())
|
||||||
|
return;
|
||||||
|
|
||||||
{
|
{
|
||||||
boost::interprocess::sharable_lock<boost::interprocess::interprocess_upgradable_mutex> sl(mMonitorLock);
|
boost::interprocess::sharable_lock<boost::interprocess::interprocess_upgradable_mutex> sl(mMonitorLock);
|
||||||
|
|
||||||
|
|||||||
@@ -801,6 +801,9 @@ void WSConnection::doLedgerEntry(Json::Value& jvResult, const Json::Value& jvReq
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The objective is to allow the client to know the server's status. The only thing that show the server is fully operating is the
|
||||||
|
// stream of ledger_closeds. Therefore, that is all that is provided. A client can drop servers that do not provide recent
|
||||||
|
// ledger_closeds.
|
||||||
void WSConnection::doServerSubscribe(Json::Value& jvResult, const Json::Value& jvRequest)
|
void WSConnection::doServerSubscribe(Json::Value& jvResult, const Json::Value& jvRequest)
|
||||||
{
|
{
|
||||||
if (!mNetwork.subLedger(this))
|
if (!mNetwork.subLedger(this))
|
||||||
@@ -812,12 +815,12 @@ void WSConnection::doServerSubscribe(Json::Value& jvResult, const Json::Value& j
|
|||||||
if (theConfig.RUN_STANDALONE)
|
if (theConfig.RUN_STANDALONE)
|
||||||
jvResult["stand_alone"] = 1;
|
jvResult["stand_alone"] = 1;
|
||||||
|
|
||||||
// XXX Make sure these values are available before returning them.
|
if (NetworkOPs::omDISCONNECTED != mNetwork.getOperatingMode()) {
|
||||||
// XXX return connected status.
|
|
||||||
jvResult["ledger_closed"] = mNetwork.getClosedLedger().ToString();
|
jvResult["ledger_closed"] = mNetwork.getClosedLedger().ToString();
|
||||||
jvResult["ledger_current_index"] = mNetwork.getCurrentLedgerID();
|
jvResult["ledger_current_index"] = mNetwork.getCurrentLedgerID();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WSConnection::doServerUnsubscribe(Json::Value& jvResult, const Json::Value& jvRequest)
|
void WSConnection::doServerUnsubscribe(Json::Value& jvResult, const Json::Value& jvRequest)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user