Closed intelliot closed 1 year ago
Docs were updated here https://github.com/XRPLF/xrpl-dev-portal/pull/824
In 3 years, no one has expressed a desire for txn_count in the subLedger response, so this is being closed. Feel free to re-open or create a new issue if this is something you're interested in.
Summary
When a client subscribes to the
ledger
stream, the response includes all of the same fields as aledgerClosed
message but with two exceptions:"type": "ledgerClosed"
"txn_count"
(TheNumber
of new transactions included in this ledger version)This feature request is for the
txn_count
field to be added to thesubLedger
response.Motivation
It seems OK to omit the
type
field because it differentiates the immediately response to thesubscribe
request from the subsequent ledger stream messages. However, it is strange that thetxn_count
field is omitted.Solution
The code for the
subLedger
response: https://github.com/ripple/rippled/blob/3d952f4b2e295059d6ee0982f20b52b1c3e4064e/src/ripple/app/misc/NetworkOPs.cpp#L3056-L3080The code for the subsequent ledger stream messages: https://github.com/ripple/rippled/blob/3d952f4b2e295059d6ee0982f20b52b1c3e4064e/src/ripple/app/misc/NetworkOPs.cpp#L2676-L2711
By stepping through the code, you can see that the fields are identical aside from the two exceptions noted above.
Paths Not Taken
We could leave status quo, and just clarify the difference in the documentation. I'll open a PR for the docs to do exactly this. But assuming that adding
txn_count
is not expensive, it may be worth adding. It would simplify the docs by allowing us to say that the fields in thesubscribe
response are identical to the fields in the ledger stream messages.