mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 11:45:53 +00:00
round age to zero when negative (#137)
This commit is contained in:
@@ -54,6 +54,10 @@ doServerInfo(Context const& context)
|
|||||||
lgrInfo->closeTime.time_since_epoch().count() - 946684800;
|
lgrInfo->closeTime.time_since_epoch().count() - 946684800;
|
||||||
auto& validatedLgr =
|
auto& validatedLgr =
|
||||||
(response["validated_ledger"] = boost::json::object{}).as_object();
|
(response["validated_ledger"] = boost::json::object{}).as_object();
|
||||||
|
|
||||||
|
if (age < 0)
|
||||||
|
age = 0;
|
||||||
|
|
||||||
validatedLgr["age"] = age;
|
validatedLgr["age"] = age;
|
||||||
validatedLgr["hash"] = ripple::strHex(lgrInfo->hash);
|
validatedLgr["hash"] = ripple::strHex(lgrInfo->hash);
|
||||||
validatedLgr["seq"] = lgrInfo->seq;
|
validatedLgr["seq"] = lgrInfo->seq;
|
||||||
|
|||||||
Reference in New Issue
Block a user