@@ -588,12 +588,16 @@ 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,
592
+ /// HTLC-Success, or HTLC-Timeout transaction.
593
+ resolving_txid : Option < Txid > , // Added as optional, but always filled in, in 0.0.110
591
594
/// Only set if the HTLC claim was ours using a payment preimage
592
595
payment_preimage : Option < PaymentPreimage > ,
593
596
}
594
597
595
598
impl_writeable_tlv_based ! ( IrrevocablyResolvedHTLC , {
596
599
( 0 , commitment_tx_output_idx, required) ,
600
+ ( 1 , resolving_txid, option) ,
597
601
( 2 , payment_preimage, option) ,
598
602
} ) ;
599
603
@@ -2719,7 +2723,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2719
2723
htlc_value_satoshis,
2720
2724
} ) ) ;
2721
2725
if let Some ( idx) = commitment_tx_output_idx {
2722
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx : idx, payment_preimage : None } ) ;
2726
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2727
+ commitment_tx_output_idx : idx, resolving_txid : Some ( entry. txid ) ,
2728
+ payment_preimage : None ,
2729
+ } ) ;
2723
2730
}
2724
2731
} ,
2725
2732
OnchainEvent :: MaturingOutput { descriptor } => {
@@ -2729,7 +2736,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2729
2736
} ) ;
2730
2737
} ,
2731
2738
OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, preimage, .. } => {
2732
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx, payment_preimage : preimage } ) ;
2739
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2740
+ commitment_tx_output_idx, resolving_txid : Some ( entry. txid ) ,
2741
+ payment_preimage : preimage,
2742
+ } ) ;
2733
2743
} ,
2734
2744
OnchainEvent :: FundingSpendConfirmation { commitment_tx_to_counterparty_output, .. } => {
2735
2745
self . funding_spend_confirmed = Some ( entry. txid ) ;
0 commit comments