mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 17:27:55 +00:00
Cosmetic: Don't report a nonsense age in the human-readable server_info
This commit is contained in:
@@ -1205,7 +1205,16 @@ Json::Value NetworkOPs::getServerInfo(bool human, bool admin)
|
|||||||
static_cast<double>(Json::UInt(lpClosed->getReserve(0) * baseFee / baseRef)) / SYSTEM_CURRENCY_PARTS;
|
static_cast<double>(Json::UInt(lpClosed->getReserve(0) * baseFee / baseRef)) / SYSTEM_CURRENCY_PARTS;
|
||||||
l["reserve_inc_xrp"] =
|
l["reserve_inc_xrp"] =
|
||||||
static_cast<double>(Json::UInt(lpClosed->getReserveInc() * baseFee / baseRef)) / SYSTEM_CURRENCY_PARTS;
|
static_cast<double>(Json::UInt(lpClosed->getReserveInc() * baseFee / baseRef)) / SYSTEM_CURRENCY_PARTS;
|
||||||
l["age"] = Json::UInt(getCloseTimeNC() - lpClosed->getCloseTimeNC());
|
|
||||||
|
uint32 closeTime = getCloseTimeNC();
|
||||||
|
uint32 lCloseTime = lpClosed->getCloseTimeNC();
|
||||||
|
|
||||||
|
if (lCloseTime <= closeTime)
|
||||||
|
{
|
||||||
|
uint32 age = closeTime - lCloseTime;
|
||||||
|
if (age < 1000000)
|
||||||
|
l["age"] = Json::UInt(age);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
info["closed_ledger"] = l;
|
info["closed_ledger"] = l;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user