@@ -588,12 +588,17 @@ pub enum Balance {
588
588
#[ derive( PartialEq ) ]
589
589
struct IrrevocablyResolvedHTLC {
590
590
commitment_tx_output_idx : u32 ,
591
+ /// The txid of the transaction which resolved the HTLC, this may be a commitment (if the HTLC
592
+ /// was not present in the confirmed commitment transaction), HTLC-Success, or HTLC-Timeout
593
+ /// transaction.
594
+ resolving_txid : Option < Txid > , // Added as optional, but always filled in, in 0.0.110
591
595
/// Only set if the HTLC claim was ours using a payment preimage
592
596
payment_preimage : Option < PaymentPreimage > ,
593
597
}
594
598
595
599
impl_writeable_tlv_based ! ( IrrevocablyResolvedHTLC , {
596
600
( 0 , commitment_tx_output_idx, required) ,
601
+ ( 1 , resolving_txid, option) ,
597
602
( 2 , payment_preimage, option) ,
598
603
} ) ;
599
604
@@ -2723,7 +2728,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2723
2728
htlc_value_satoshis,
2724
2729
} ) ) ;
2725
2730
if let Some ( idx) = commitment_tx_output_idx {
2726
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx : idx, payment_preimage : None } ) ;
2731
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2732
+ commitment_tx_output_idx : idx, resolving_txid : Some ( entry. txid ) ,
2733
+ payment_preimage : None ,
2734
+ } ) ;
2727
2735
}
2728
2736
} ,
2729
2737
OnchainEvent :: MaturingOutput { descriptor } => {
@@ -2733,7 +2741,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2733
2741
} ) ;
2734
2742
} ,
2735
2743
OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, preimage, .. } => {
2736
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx, payment_preimage : preimage } ) ;
2744
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2745
+ commitment_tx_output_idx, resolving_txid : Some ( entry. txid ) ,
2746
+ payment_preimage : preimage,
2747
+ } ) ;
2737
2748
} ,
2738
2749
OnchainEvent :: FundingSpendConfirmation { commitment_tx_to_counterparty_output, .. } => {
2739
2750
self . funding_spend_confirmed = Some ( entry. txid ) ;
0 commit comments