diff --git a/src/xrpld/app/ledger/detail/LedgerToJson.cpp b/src/xrpld/app/ledger/detail/LedgerToJson.cpp index 10a3e5c0bd..7c03e22580 100644 --- a/src/xrpld/app/ledger/detail/LedgerToJson.cpp +++ b/src/xrpld/app/ledger/detail/LedgerToJson.cpp @@ -297,13 +297,24 @@ fillJsonQueue(json::Value& json, LedgerFill const& fill) txJson["last_result"] = transToken(*tx.lastResult); auto&& temp = fillJsonTx(fill, bBinary, bExpanded, tx.txn, nullptr); - if (fill.context->apiVersion > 1) + if (temp.isObject()) { - copyFrom(txJson, temp); + if (fill.context->apiVersion > 1) + { + copyFrom(txJson, temp); + } + else + { + copyFrom(txJson[jss::tx], temp); + } + } + else if (fill.context->apiVersion > 1) + { + txJson[jss::hash] = temp; } else { - copyFrom(txJson[jss::tx], temp); + txJson[jss::tx] = temp; } } }