@@ -606,6 +606,10 @@ pub enum Balance {
606606 /// The height at which the counterparty may be able to claim the balance if we have not
607607 /// done so.
608608 timeout_height : u32 ,
609+ /// The payment hash that locks this HTLC.
610+ payment_hash : PaymentHash ,
611+ /// The preimage that can be used to claim this HTLC.
612+ payment_preimage : PaymentPreimage ,
609613 } ,
610614 /// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
611615 /// fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
@@ -1602,9 +1606,10 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
16021606 return Some ( Balance :: MaybeTimeoutClaimableHTLC {
16031607 claimable_amount_satoshis : htlc. amount_msat / 1000 ,
16041608 claimable_height : htlc. cltv_expiry ,
1609+ payment_hash : htlc. payment_hash ,
16051610 } ) ;
16061611 }
1607- } else if self . payment_preimages . get ( & htlc. payment_hash ) . is_some ( ) {
1612+ } else if let Some ( payment_preimage ) = self . payment_preimages . get ( & htlc. payment_hash ) {
16081613 // Otherwise (the payment was inbound), only expose it as claimable if
16091614 // we know the preimage.
16101615 // Note that if there is a pending claim, but it did not use the
@@ -1620,6 +1625,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
16201625 return Some ( Balance :: ContentiousClaimable {
16211626 claimable_amount_satoshis : htlc. amount_msat / 1000 ,
16221627 timeout_height : htlc. cltv_expiry ,
1628+ payment_hash : htlc. payment_hash ,
1629+ payment_preimage : * payment_preimage,
16231630 } ) ;
16241631 }
16251632 } else if htlc_resolved. is_none ( ) {
0 commit comments