add server info

This commit is contained in:
CJ Cobb
2021-06-01 13:33:52 -04:00
parent 46d4ee4548
commit d692f7f675
17 changed files with 200 additions and 61 deletions

View File

@@ -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
{