@@ -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
@@ -2727,7 +2732,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2727
2732
htlc_value_satoshis,
2728
2733
} ) ) ;
2729
2734
if let Some ( idx) = commitment_tx_output_idx {
2730
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx : idx, payment_preimage : None } ) ;
2735
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2736
+ commitment_tx_output_idx : idx, resolving_txid : Some ( entry. txid ) ,
2737
+ payment_preimage : None ,
2738
+ } ) ;
2731
2739
}
2732
2740
} ,
2733
2741
OnchainEvent :: MaturingOutput { descriptor } => {
@@ -2737,7 +2745,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
2737
2745
} ) ;
2738
2746
} ,
2739
2747
OnchainEvent :: HTLCSpendConfirmation { commitment_tx_output_idx, preimage, .. } => {
2740
- self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC { commitment_tx_output_idx, payment_preimage : preimage } ) ;
2748
+ self . htlcs_resolved_on_chain . push ( IrrevocablyResolvedHTLC {
2749
+ commitment_tx_output_idx, resolving_txid : Some ( entry. txid ) ,
2750
+ payment_preimage : preimage,
2751
+ } ) ;
2741
2752
} ,
2742
2753
OnchainEvent :: FundingSpendConfirmation { commitment_tx_to_counterparty_output, .. } => {
2743
2754
self . funding_spend_confirmed = Some ( entry. txid ) ;
0 commit comments