Skip to content

multi: add reverse ordering to listchaintxns - #11365

Open
saubyk wants to merge 6 commits into
lightningnetwork:masterfrom
saubyk:7316-listchaintxns-reverse
Open

saubyk wants to merge 6 commits into
lightningnetwork:masterfrom
saubyk:7316-listchaintxns-reverse

Conversation

@saubyk

@saubyk saubyk commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #7316.

GetTransactions / lncli listchaintxns has always returned transactions newest-first. RPCTransactionDetails unconditionally re-sorts the wallet result by confirmations ascending, so the reverse ordering documented for start_height > end_height never reached RPC clients, and since #9558 the CLI rejects that range anyway. There was no way to list transactions oldest-first.

Changes

  • Add a reverse flag to GetTransactionsRequest and --reverse to lncli listchaintxns. When set, transactions are returned oldest-first with unconfirmed transactions last. The default ordering is unchanged. SubscribeTransactions shares the request message and ignores the flag, which the field comment states.
  • Switch the sort in RPCTransactionDetails to sort.SliceStable. Same-block and unconfirmed transactions share a confirmation count, so the unstable sort could reorder them between calls. Pagination happens in the wallet layer before this sort, so this only makes the order within a page deterministic.
  • Fix the stale ListTransactionDetails doc comments that still described the non-functional reversal.

Pagination semantics

index_offset always counts from the oldest transaction, in both modes. reverse only changes the order of the returned page, so the same page and first_index/last_index come back either way. Reversing before pagination (as sketched in the issue) would make a client paging oldest-first receive the wrong page. If reviewers prefer reverse-before-pagination, that is a small follow-up through WalletController.ListTransactionDetails.

Testing

  • TestRPCTransactionDetailsOrdering pins the exact order in both modes, including tie-breaking.
  • TestRPCTransactionDetailsPaginationOrdering pins that the same page is returned in both modes.
  • Unit tests for lnrpc, lnwallet, lnwallet/btcwallet, cmd/commands and the lnwallet/test suites (bitcoind, btcd, neutrino) pass.

@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from 1e8e5d9 to f286bcb Compare October 19, 2026 19:45
@saubyk saubyk self-assigned this Oct 19, 2026
@saubyk saubyk added this to lnd v0.22 Oct 19, 2026
@github-project-automation github-project-automation Bot moved this to Backlog in lnd v0.22 Oct 19, 2026
@saubyk saubyk moved this from Backlog to In progress in lnd v0.22 Oct 19, 2026
@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from f286bcb to 2fbc69f Compare October 19, 2026 19:53
@saubyk

saubyk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

/gateway review

@saubyk saubyk added this to the v0.22.0 milestone Oct 19, 2026

@lightninglabs-gateway lightninglabs-gateway Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gateway review — 2 findings

🔴 0 Blocker · 🟠 0 Major · 🟡 2 Minor · 🔵 0 Nit

Summary

This PR adds a reverse flag to GetTransactions and lncli listchaintxns, so transactions can be listed oldest-first. It also switches the confirmation sort to sort.SliceStable and corrects the stale ListTransactionDetails docs. The change is small and correct for its main goal. Default ordering is unchanged, every RPCTransactionDetails caller visible in the diff is updated (ListSweeps passes false), and the new tests pin the exact output order in both modes.

Neither concern below is a defect. First, the PR's justification for the stable sort is wrong: pagination runs in the wallet layer before this sort, so the sort was never able to skip or duplicate transactions across pages. The doc comment and release note should stop saying it does. Second, the new field sits on a request message that SubscribeTransactions also uses, and nothing tells streaming clients that reverse does nothing there.

Lower-severity findings (2)

🟡 F1 (Minor) — Stable-sort docs claim a pagination fix that cannot occur · lnrpc/rpc_utils.go:126

RPCTransactionDetails only ever gets the page the wallet has already cut: rpcserver.go passes it txns, firstIdx, lastIdx from ListTransactionDetails, and the PR's own TestRPCTransactionDetailsPaginationOrdering says pagination "is applied by the wallet layer before RPCTransactionDetails is invoked". So the old sort.Slice could only reorder tied transactions inside a page; it could never make index_offset/max_transactions skip or duplicate anything. The stable sort is still worth keeping, because it makes the order inside a page deterministic. But the NOTE at rpc_utils.go:126-130 and the release note (docs/release-notes/unreleased/11365.md:8-12) present it as a pagination bug fix, which will mislead future readers. Reword both to say it gives a deterministic order within a page.

🟡 F2 (Minor) — reverse is silently ignored by SubscribeTransactions · lnrpc/lightning.proto:835

GetTransactionsRequest is also the request type for SubscribeTransactions (lightning.proto:80). The new reverse field therefore shows up on that streaming RPC too, and the regenerated swagger lists it on a second endpoint (lightning.swagger.json ~2918). Nothing in this diff reads it there, so a client that sets it on the stream gets no error and no effect. Add a sentence to the field comment saying it only applies to GetTransactions.

Reviewed at medium effort.

Bot commands
  • /gateway re-review — re-run after pushing changes (maintainers)
  • /gateway dismiss <id> — silence a finding (maintainers)
  • /gateway explain <id> — elaborate on a finding (anyone)

@lightninglabs-gateway

lightninglabs-gateway Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🤖 gateway audit metadata for this PR — auto-generated, please don't edit.

@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from 2fbc69f to ed47e28 Compare October 19, 2026 23:43
@saubyk

saubyk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed both Gateway findings in ed47e28:

  • F1: the stable sort was never a pagination fix, since the wallet layer pages before RPCTransactionDetails sorts. Reworded the NOTE in rpc_utils.go, the test comment, the release note, the commit message and the PR description to say it only makes the order within a page deterministic.
  • F2: added to the reverse field comment that it only applies to GetTransactions and is ignored by SubscribeTransactions, and regenerated the stubs.

@saubyk

saubyk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

/gateway re-review

@lightninglabs-gateway lightninglabs-gateway Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gateway review

No findings.


Status of prior findings

  • F1 addressed: Fixed in lnrpc/rpc_utils.go:126-130, and the release note matches at docs/release-notes/unreleased/11365.md:8-11. The NOTE now says the stable sort gives "the returned page a deterministic order" and that pagination "is applied by the wallet layer before this sort and is unaffected by it". The release note now says "so the order within a page is deterministic", so the stable sort is no longer described as a pagination fix.
  • F2 addressed: Fixed in lnrpc/lightning.proto:833-834. The field comment now says "This flag only applies to GetTransactions and is ignored by SubscribeTransactions." The regenerated lightning.pb.go (2428-2429) carries the same sentence, as do both swagger reverse parameters (~2706 and ~2919).

Reviewed at medium effort.

Bot commands
  • /gateway re-review — re-run after pushing changes (maintainers)
  • /gateway dismiss <id> — silence a finding (maintainers)
  • /gateway explain <id> — elaborate on a finding (anyone)

@saubyk

saubyk commented Oct 19, 2026

Copy link
Copy Markdown
Collaborator Author

/gateway approve

@saubyk saubyk added rpc Related to the RPC interface wallet The wallet (lnwallet) which LND uses cli Related to the command line interface labels Oct 19, 2026

@lightninglabs-gateway lightninglabs-gateway Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved — all prior findings addressed.

Findings recap

Findings:

  • F1 (minor) — addressed: RPCTransactionDetails only ever gets the page the wallet has already cut: rpcserver.go passes it txns, firstIdx, lastIdx from `ListTra…
  • F2 (minor) — addressed: GetTransactionsRequest is also the request type for SubscribeTransactions (lightning.proto:80). The new reverse field therefore show…

Approved by @saubyk via /gateway approve. Last reviewed at ed47e28. Skill v0.6.0, model claude-opus-5-5.

@Abdulkbk

Copy link
Copy Markdown
Contributor

Lint CI is failing

@yyforyongyu
yyforyongyu self-requested a review October 20, 2026 08:28
@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from ed47e28 to 6cf1f37 Compare October 20, 2026 15:12
@github-actions github-actions Bot added the severity-critical Requires expert review - security/consensus critical label Oct 20, 2026
@github-actions

Copy link
Copy Markdown

🔴 PR Severity: CRITICAL

gh pr view diff | 11 files | 371 lines changed

🔴 Critical (3 files)
  • lnwallet/btcwallet/btcwallet.go - wallet backend transaction-listing logic (lnwallet/*)
  • lnwallet/interface.go - LightningWallet interface signature change (lnwallet/*)
  • rpcserver.go - core server coordination, explicitly critical
🟠 High (4 files)
  • lnrpc/rpc_utils.go - RPC transaction sort/pagination helper (lnrpc/*)
  • lnrpc/walletrpc/walletkit_server.go - wallet RPC server wiring (lnrpc/*)
  • lnrpc/lightning.pb.go - generated gRPC bindings for new field (lnrpc/*)
  • lnrpc/lightning.swagger.json - generated REST/swagger schema (lnrpc/*)
🟡 Medium (2 files)
  • cmd/commands/commands.go - CLI flag for reverse transaction listing (cmd/*)
  • lnrpc/lightning.proto - proto schema change adding reverse field (*.proto)
🟢 Low (2 files)
  • docs/release-notes/unreleased/11365.md - release note
  • lnrpc/rpc_utils_test.go - test-only addition

Analysis

This PR adds a reverse option for GetTransactions/ListTransactionDetails and a stable sort for deterministic ordering within a page. While most of the diff is RPC plumbing and a CLI flag, it also changes lnwallet/interface.go (the LightningWallet interface) and lnwallet/btcwallet/btcwallet.go (wallet backend implementation), plus rpcserver.go, which is explicitly called out as core server coordination. Touching the wallet interface and its backend implementation warrants expert review even though the functional change (transaction listing order/pagination) is relatively low-risk — interface changes in lnwallet/* ripple into wallet correctness guarantees. File/line counts after excluding tests and generated files (9 files, ~130 lines) are well under the bump thresholds, so no additional bump was applied beyond the base CRITICAL classification.


To override, add a severity-override-{critical,high,medium,low} label.

@saubyk

saubyk commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator Author

Lint CI is failing

CI is green now

@yyforyongyu yyforyongyu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, left a few comments.

Could you check whether the sql-wallet needs to implement this in the tx table? cc @Abdulkbk If so we may need a small PR to enable it, should be small as it's a simple sql query.

Comment thread lnrpc/lightning.proto Outdated
the default ordering is used, which lists unconfirmed transactions
first, followed by the most recent confirmed transactions down to the
oldest. Pagination (index_offset/max_transactions) always walks the
result set starting from the oldest transaction, regardless of this

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RPC clients can still send start_height > end_height, and the wallet then paginates newest-first before this sort. Can we validate the range at the RPC boundary or qualify the oldest-first ordering docs?

@Abdulkbk Abdulkbk Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, the wallet does read blocks in reverse for start_height > end_height, so the page selection differs for that range even though the response order never showed it. Went with qualifying the docs rather than rejecting the range, to avoid breaking clients that rely on it today: the start_height comment now describes the reversed page selection, the reverse field comment says the same page is selected regardless of the flag (from the oldest, or from the newest when start_height > end_height), and the lnwallet docs in the first commit describe the wallet-layer ordering for both ranges rather than dropping the reverse-read statement.

Comment thread lnrpc/rpc_utils_test.go Outdated
// changes the order in which the returned page is presented: by default the
// most recent transaction of the page comes first, with reverse set the
// oldest transaction of the page comes first.
func TestRPCTransactionDetailsPaginationOrdering(t *testing.T) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we fold this into TestRPCTransactionDetailsOrdering? It repeats newDetail, the same seven transactions and txHashes, then slices the page by hand, so it does not exercise pagination. Keep the nonzero index checks in the ordering test and let TestTransactionDetailsPage cover page selection.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Folded into TestRPCTransactionDetailsOrdering, which now asserts the nonzero first/last index pass-through in both modes and leaves page selection to TestTransactionDetailsPage.

Comment thread lnrpc/rpc_utils_test.go
// transactions from the oldest block to the newest, with unconfirmed
// transactions last. Two transactions share the same block (the two
// with 3 confirmations) to exercise the stable sort tie-breaking.
txns := []*lnwallet.TransactionDetail{

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The old sort.Slice passes this exact fixture in both directions, so this does not catch the stability regression. Can we use a larger tie-heavy fixture that fails with the unstable sort?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, sort.Slice falls back to insertion sort for <= 12 elements so the old fixture could not catch it. The fixture is now 17 transactions with four-way ties in three blocks plus four unconfirmed, and I confirmed it fails with sort.Slice and passes with sort.SliceStable.

Comment thread lnrpc/lightning.proto
transactions within the response changes. This flag only applies to
GetTransactions and is ignored by SubscribeTransactions.
*/
bool reverse = 6;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we split 93ea04be0 into separate commits for the proto source and generated Go/Swagger output?

Optional: 9edce700e and 6cf1f37ec could be squashed since the release note belongs with the CLI flag. Keep the independent stable-sort fix separate.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done: the proto source and the regenerated Go/Swagger output are now separate commits, the CLI flag and release note are squashed, and the stable-sort fix remains its own commit.

@Abdulkbk Abdulkbk left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good. Left a few comments as well.

Comment thread lnrpc/rpc_utils.go
// by height, unconfirmed transactions will follow our oldest
// transactions, because they have lower block heights.
sort.Slice(txDetails.Transactions, func(i, j int) bool {
sort.SliceStable(txDetails.Transactions, func(i, j int) bool {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: with SliceStable in both directions, ties keep the wallet's order in both modes, so reverse isn't the reverse of the default for same-block or unconfirmed transactions (e.g. cc, dd and ff, 11 come out the same way round in both orderings of TestRPCTransactionDetailsOrdering).

If "reverse" should be an exact mirror, one descending sort plus a reversal for the default would do it:

sort.SliceStable(txDetails.Transactions, func(i, j int) bool {
	return txDetails.Transactions[i].NumConfirmations >
		txDetails.Transactions[j].NumConfirmations
})
if !reverse {
	slices.Reverse(txDetails.Transactions)
}

That flips how ties appear in the default output. Their order was never specified before, but it's worth knowing. Otherwise, can we note in the doc comment that ties stay in wallet order in both modes? The tie-heavy fixture yy asked for would pin either choice.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kept ties in wallet order in both modes rather than mirroring, since mirroring would change the default output's tie order for existing clients. Documented it in the RPCTransactionDetails doc comment and the proto field comment, and the larger fixture now pins it (a1 precedes a2 in both orderings).

@@ -0,0 +1,12 @@
# Bug Fixes

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the new RPC field and CLI flag fit better under # New Features → ## RPC Additions / ## lncli Additions from release-notes-template.md. The stable-sort note can stay under # Bug Fixes.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the RPC field under New Features / RPC Additions and the CLI flag under lncli Additions; the stable sort stays under Bug Fixes.

Comment thread lnrpc/rpc_utils_test.go Outdated
// txHash returns a 64 character hex transaction hash with the given two
// character hex prefix, so transactions are easy to tell apart in test
// failures.
var txHash = func(prefix string) string {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: can this be a plain func txHash(prefix string) string declaration rather than a package-level var? Also, newDetail sets BlockHash = h, the transaction's own hash, so cc and dd share a height but carry different block hashes. Deriving the block hash from BlockHeight would keep the fixture consistent.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both done: txHash is a plain func now, and the fixture derives the block hash from the block height so same-block transactions share it.

@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from 6cf1f37 to 7446d87 Compare October 22, 2026 17:43
@saubyk

saubyk commented Oct 22, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the review feedback in 7446d87, see the inline replies for details.

On the sql-wallet question: no wallet-side change is needed for this PR. The reverse flag is applied in the RPC layer on the page the wallet already returned, and the WalletController.ListTransactionDetails signature is unchanged (only its docs). @Abdulkbk is there any expectation of a change in this PR for the SQL transaction store work, or is this just something to keep in mind there?

Comment thread lnrpc/lightning.proto
/*
The height from which to list transactions, inclusive. If this value is
greater than end_height, transactions will be read in reverse.
greater than end_height, the wallet reads the blocks in reverse, so

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we account for the -1 sentinel here? With start_height=0,end_height=-1, the wallet treats -1 as the tip and paginates oldest-first, even though 0 > -1. An omitted RPC end height uses the same path. Qualify this in both proto comments and the wallet docs, then regenerate the Go/Swagger output.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in a24898a. Confirmed in wtxmgr that any negative height is rewritten to the maximum height before the direction comparison, so start_height=0 with end_height=-1 (or an omitted end_height) reads forward, oldest-first. Both proto height comments and the lnwallet interface doc now state that -1 counts as the chain tip for that comparison, with the 0/-1 example, and the Go/Swagger output is regenerated.

Comment thread lnrpc/rpc_utils_test.go Outdated
// which Go's unstable sort.Slice happens to be stable (it falls back to
// insertion sort for 12 or fewer elements), so that an unstable sort would
// reorder the ties and fail the ordering assertions.
func walletOrderedTxns(t *testing.T) []*lnwallet.TransactionDetail {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we inline this fixture into TestRPCTransactionDetailsOrdering? It has one caller and only wraps a slice literal, so the helper adds a hop without removing duplication. Keep newTxDetail and the ordering/index assertions as they are.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inlined the slice literal into TestRPCTransactionDetailsOrdering with its comment; newTxDetail and the ordering/index assertions are unchanged.

@Abdulkbk

Copy link
Copy Markdown
Contributor

Could you check whether the sql-wallet needs to implement this in the tx table? cc @Abdulkbk If so we may need a small PR to enable it, should be small as it's a simple sql query.

No change expected AFAIK. LND still reads through the deprecated GetTransactions, which works against wtxmgr. LND tx listing needs to move to Wallet.ListTxns regardless. When it does, the documented order already holds there: (start, -1) returns confirmed rows by block_height, confirmed_order, id with unmined last, and start > end returns blocks newest-first with in-block order preserved, same as wtxmgr. cc: @yyforyongyu @saubyk

The doc comments on WalletController.ListTransactionDetails and the
btcwallet implementation only described the reverse read for a start
height greater than the end height, and said nothing about the order
of the returned transactions or how pagination relates to it.

Document the ordering the wallet layer actually produces: confirmed
transactions from the oldest to the newest block for a regular range,
from the newest to the oldest block when start height is greater than
end height, and unconfirmed transactions last in both cases. The
special end height -1 counts as the chain tip for that comparison, so a
start height of 0 with an end height of -1 is a regular, oldest-first
range. Note that pagination is applied over that ordering and that any
presentation ordering is left to the caller.
RPCTransactionDetails sorted transactions by number of confirmations
using sort.Slice, which is not stable. Transactions sharing a number of
confirmations (several in the same block, or several unconfirmed ones)
could therefore change their relative order between calls.

Switch to sort.SliceStable so ties keep the relative order produced by
the wallet layer, giving the returned page a deterministic order.
Pagination (index_offset/max_transactions) is applied by the wallet
layer before this sort, so it was never affected by the instability.

Fold the inline ordering rationale into the doc comment and add a test
asserting the exact resulting order. The fixture is tie-heavy and
larger than 12 elements, below which sort.Slice falls back to an
insertion sort that happens to be stable, so the test fails with the
previous unstable sort.
Add an explicit reverse flag to GetTransactionsRequest so callers can
request wallet transactions oldest-first, with unconfirmed transactions
last. The flag only changes the order of the transactions within the
response; pagination (index_offset/max_transactions) selects the same
page either way. Ties on the number of confirmations keep the order
produced by the wallet in both modes, which the field comment states
explicitly.

SubscribeTransactions shares this request message but does not honour
the flag, which the field comment also states.

Also correct the start_height docs: a start_height greater than
end_height makes the wallet read blocks in reverse, which changes the
page that pagination selects, but the response ordering has always been
governed by the RPC layer and is now governed by the reverse flag. An
end_height of -1 (the default) counts as the chain tip for that
comparison, so start_height=0 with end_height=-1 is a regular
oldest-first range, which both height comments now state.
Regenerate the Go and Swagger output for the new reverse field and the
updated start_height docs.
The GetTransactions RPC has always returned wallet transactions
newest-first: RPCTransactionDetails unconditionally re-sorted the
result by number of confirmations in ascending order, which destroyed
the ordering produced by the wallet layer and left no way to list
transactions oldest-first.

Add a reverse parameter to RPCTransactionDetails that sorts by number
of confirmations in descending order instead, putting the oldest
confirmed transactions first and unconfirmed transactions last, and
pass the new GetTransactionsRequest.reverse flag through from the
rpcserver. ListSweeps keeps the default ordering. The default ordering
is unchanged.

Ties on the number of confirmations keep the wallet order in both
modes, so the reverse ordering is not an exact mirror of the default
one for them. This is documented and pinned by the ordering test, which
is extended to cover the reverse case and to assert that the page
indexes are passed through unmodified in both modes.

Fixes lightningnetwork#7316
Expose the new GetTransactionsRequest.reverse field as a --reverse
flag on lncli listchaintxns, and document both the default ordering
(unconfirmed first, then newest to oldest confirmed) and the reverse
ordering (oldest confirmed first, unconfirmed last) in the command
description.

Add the release note for the new RPC field, the new CLI flag and the
stable sort.
@saubyk
saubyk force-pushed the 7316-listchaintxns-reverse branch from 7446d87 to a24898a Compare October 24, 2026 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command line interface gateway-active gateway-approved rpc Related to the RPC interface severity-critical Requires expert review - security/consensus critical wallet The wallet (lnwallet) which LND uses

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

[bug]: lncli listchaintxns in reversed order

3 participants