mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-01 09:05:51 +00:00
add server info
This commit is contained in:
@@ -37,19 +37,7 @@ doLedger(boost::json::object const& request, BackendInterface const& backend)
|
||||
}
|
||||
else
|
||||
{
|
||||
header["ledger_sequence"] = lgrInfo->seq;
|
||||
header["ledger_hash"] = ripple::strHex(lgrInfo->hash);
|
||||
header["txns_hash"] = ripple::strHex(lgrInfo->txHash);
|
||||
header["state_hash"] = ripple::strHex(lgrInfo->accountHash);
|
||||
header["parent_hash"] = ripple::strHex(lgrInfo->parentHash);
|
||||
header["total_coins"] = ripple::to_string(lgrInfo->drops);
|
||||
header["close_flags"] = lgrInfo->closeFlags;
|
||||
|
||||
// Always show fields that contribute to the ledger hash
|
||||
header["parent_close_time"] =
|
||||
lgrInfo->parentCloseTime.time_since_epoch().count();
|
||||
header["close_time"] = lgrInfo->closeTime.time_since_epoch().count();
|
||||
header["close_time_resolution"] = lgrInfo->closeTimeResolution.count();
|
||||
header = toJson(*lgrInfo);
|
||||
}
|
||||
response["header"] = header;
|
||||
if (getTransactions)
|
||||
@@ -70,8 +58,8 @@ doLedger(boost::json::object const& request, BackendInterface const& backend)
|
||||
if (!binary)
|
||||
{
|
||||
auto [sttx, meta] = deserializeTxPlusMeta(obj);
|
||||
entry["transaction"] = getJson(*sttx);
|
||||
entry["metadata"] = getJson(*meta);
|
||||
entry["transaction"] = toJson(*sttx);
|
||||
entry["metadata"] = toJson(*meta);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user