Skip to content

walletkit: add RemoveTransaction client method - #284

Merged
ellemouton merged 1 commit into
lightninglabs:masterfrom
ellemouton:walletkit-removetransaction
Jul 30, 2026
Merged

walletkit: add RemoveTransaction client method#284
ellemouton merged 1 commit into
lightninglabs:masterfrom
ellemouton:walletkit-removetransaction

Conversation

@ellemouton

Copy link
Copy Markdown
Member

Adds WalletKit.RemoveTransaction to the lndclient WalletKit surface, wrapping lnd's existing WalletKit.RemoveTransaction RPC (lncli wallet removetx).

Motivation

A downstream consumer broadcasts transactions through lnd and, when it abandons one (e.g. a unilateral-exit tree tx that can no longer confirm), needs to stop lnd from perpetually rebroadcasting the now-invalid transaction from its wallet queue. lnd already exposes RemoveTransaction for exactly this, but lndclient didn't wrap it.

Change

  • WalletKitClient.RemoveTransaction(ctx, txid) — thin wrapper mirroring GetTransaction (the RPC reuses GetTransactionRequest to identify the transaction by hash, so no new request type is introduced).
  • testdata/permissions.json — adds the /walletrpc.WalletKit/RemoveTransaction entry (onchain:write), keeping the static lncli listpermissions snapshot faithful. TestMacaroonRecipe still passes — the distinct walletrpc permission count is unchanged at 3.

go build ./..., gofmt, and the test suite are green.

🤖 Generated with Claude Code

Add WalletKit.RemoveTransaction, wrapping lnd's RemoveTransaction RPC
(the programmatic form of `lncli wallet removetx`). It removes the
transaction with the given hash, and every transaction that depends on
it, from the wallet's store and its unconfirmed-rebroadcast set, so a
caller that has abandoned a transaction can stop lnd from perpetually
rebroadcasting it.

The RPC identifies the transaction by hash via GetTransactionRequest,
so no new request type is needed. The static permissions export is
updated with the onchain:write requirement, matching PublishTransaction.
@ellemouton
ellemouton merged commit c255827 into lightninglabs:master Jul 30, 2026
1 check passed
@ellemouton
ellemouton deleted the walletkit-removetransaction branch July 30, 2026 15:25
ellemouton added a commit to lightninglabs/wavelength that referenced this pull request Jul 30, 2026
Bump github.com/lightninglabs/lndclient to the master commit that adds
WalletKit.RemoveTransaction (lightninglabs/lndclient#284), which the
terminal-failure rebroadcast cleanup in this PR uses to drop an
abandoned transaction from lnd's wallet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants