@@ -588,12 +588,17 @@ pub enum Balance {
588588#[ derive( PartialEq ) ]
589589struct IrrevocablyResolvedHTLC {
590590 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
591595 /// Only set if the HTLC claim was ours using a payment preimage
592596 payment_preimage : Option < PaymentPreimage > ,
593597}
594598
595599impl_writeable_tlv_based ! ( IrrevocablyResolvedHTLC , {
596600 ( 0 , commitment_tx_output_idx, required) ,
601+ ( 1 , resolving_txid, option) ,
597602 ( 2 , payment_preimage, option) ,
598603} ) ;
599604
@@ -2727,7 +2732,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
27272732 htlc_value_satoshis,
27282733 } ) ) ;
27292734 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+ } ) ;
27312739 }
27322740 } ,
27332741 OnchainEvent :: MaturingOutput { descriptor } => {
@@ -2737,7 +2745,10 @@ impl<Signer: Sign> ChannelMonitorImpl<Signer> {
27372745 } ) ;
27382746 } ,
27392747 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+ } ) ;
27412752 } ,
27422753 OnchainEvent :: FundingSpendConfirmation { commitment_tx_to_counterparty_output, .. } => {
27432754 self . funding_spend_confirmed = Some ( entry. txid ) ;
0 commit comments