@@ -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
@@ -1604,7 +1608,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
16041608 claimable_height : htlc. cltv_expiry ,
16051609 } ) ;
16061610 }
1607- } else if self . payment_preimages . get ( & htlc. payment_hash ) . is_some ( ) {
1611+ } else if let Some ( payment_preimage ) = self . payment_preimages . get ( & htlc. payment_hash ) {
16081612 // Otherwise (the payment was inbound), only expose it as claimable if
16091613 // we know the preimage.
16101614 // Note that if there is a pending claim, but it did not use the
@@ -1620,6 +1624,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
16201624 return Some ( Balance :: ContentiousClaimable {
16211625 claimable_amount_satoshis : htlc. amount_msat / 1000 ,
16221626 timeout_height : htlc. cltv_expiry ,
1627+ payment_hash : htlc. payment_hash ,
1628+ payment_preimage : * payment_preimage,
16231629 } ) ;
16241630 }
16251631 } else if htlc_resolved. is_none ( ) {
0 commit comments