Classify onchain transactions#791
Conversation
|
👋 Thanks for assigning @jkczyz as a reviewer! |
| /// The confirmation status of this payment. | ||
| status: ConfirmationStatus, | ||
| /// The type of the on-chain transaction, if known. | ||
| tx_type: Option<TransactionType>, |
There was a problem hiding this comment.
Hmm, we should probably just default to Onchain if we don't know what it is.
| { | ||
| queue_sender: mpsc::Sender<Vec<Transaction>>, | ||
| queue_receiver: Mutex<mpsc::Receiver<Vec<Transaction>>>, | ||
| tx_types: std::sync::Mutex<HashMap<Txid, TransactionType>>, |
There was a problem hiding this comment.
If we broadcast the transaction but restart before the wallet syncs, won't we lose this data?
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?
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>
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>
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
d0dfd93 to
e487cdd
Compare
e487cdd to
811ddeb
Compare
There was a problem hiding this comment.
Should we persist before broadcasting like we do for splices?
Persist the replacement payment and pending index before enqueueing the replacement transaction. This avoids a crash window where the tx could reach the chain source without a durable payment record. Co-Authored-By: HAL 9000
Keep known on-chain transaction types across wallet sync updates. Co-Authored-By: HAL 9000
Record close, claim, anchor-bump, and sweep broadcasts. Wallet sync can then retain the LDK transaction type. Co-Authored-By: HAL 9000
811ddeb to
57b7115
Compare
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.