Classify onchain transactions#791
Open
tnull wants to merge 4 commits into
Open
Conversation
|
👋 Hi! This PR is now in draft status. |
tnull
commented
Feb 11, 2026
| /// The confirmation status of this payment. | ||
| status: ConfirmationStatus, | ||
| /// The type of the on-chain transaction, if known. | ||
| tx_type: Option<TransactionType>, |
Collaborator
Author
There was a problem hiding this comment.
Hmm, we should probably just default to Onchain if we don't know what it is.
jkczyz
reviewed
Apr 20, 2026
| { | ||
| queue_sender: mpsc::Sender<Vec<Transaction>>, | ||
| queue_receiver: Mutex<mpsc::Receiver<Vec<Transaction>>>, | ||
| tx_types: std::sync::Mutex<HashMap<Txid, TransactionType>>, |
Contributor
There was a problem hiding this comment.
If we broadcast the transaction but restart before the wallet syncs, won't we lose this data?
Collaborator
Author
There was a problem hiding this comment.
Yeah, we need to double-check whether we need to persist this. I think most channel-related transactions will be regenerated/rebroadcast after restart, but not sure if that would be the case for splice-related data?
jkczyz
added a commit
to jkczyz/ldk-node
that referenced
this pull request
Jun 25, 2026
On-chain payment records don't capture what a transaction was for -- a channel open, splice, close, sweep, or a plain send. Record that classification on each on-chain payment, derived from the type LDK reports when broadcasting the transaction, so it survives restarts alongside the payment. The tag keeps only which channels a transaction relates to; amounts and fees stay on the payment. Existing records keep decoding unchanged. Compatible with the on-chain transaction classification proposed in lightningdevkit#791. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jkczyz
added a commit
to jkczyz/ldk-node
that referenced
this pull request
Jun 26, 2026
On-chain payment records don't capture what a transaction was for -- a channel open, splice, close, sweep, or a plain send. Record that classification on each on-chain payment, derived from the type LDK reports when broadcasting the transaction, so it survives restarts alongside the payment. The tag keeps only which channels a transaction relates to; amounts and fees stay on the payment. Existing records keep decoding unchanged. Compatible with the on-chain transaction classification proposed in lightningdevkit#791. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jkczyz
added a commit
to jkczyz/ldk-node
that referenced
this pull request
Jun 26, 2026
On-chain payment records don't capture what a transaction was for -- a channel open, splice, close, sweep, or a plain send. Record that classification on each on-chain payment, derived from the type LDK reports when broadcasting the transaction, so it survives restarts alongside the payment. The tag keeps only which channels a transaction relates to; amounts and fees stay on the payment. Existing records keep decoding unchanged. Compatible with the on-chain transaction classification proposed in lightningdevkit#791. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Use the receiver node for receive-side on-chain checks. Co-Authored-By: HAL 9000
Avoid tagging ordinary wallet sends and rebroadcasts as LDK sweeps. They should remain on-chain payments with no transaction type. Co-Authored-By: HAL 9000
Keep known on-chain transaction types across wallet sync updates. Co-Authored-By: HAL 9000
d0dfd93 to
e487cdd
Compare
Record close, claim, anchor-bump, and sweep broadcasts. Wallet sync can then retain the LDK transaction type. Co-Authored-By: HAL 9000
e487cdd to
811ddeb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #447.
In #888 we started exposing
TransactionTypefor funding-related transactions. Here, we continue that work and also classify the remaining transaction types so they are shown in the payment store.