@@ -606,6 +606,10 @@ pub enum Balance {
606
606
/// The height at which the counterparty may be able to claim the balance if we have not
607
607
/// done so.
608
608
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 ,
609
613
} ,
610
614
/// HTLCs which we sent to our counterparty which are claimable after a timeout (less on-chain
611
615
/// fees) if the counterparty does not know the preimage for the HTLCs. These are somewhat
@@ -1604,7 +1608,7 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1604
1608
claimable_height : htlc. cltv_expiry ,
1605
1609
} ) ;
1606
1610
}
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 ) {
1608
1612
// Otherwise (the payment was inbound), only expose it as claimable if
1609
1613
// we know the preimage.
1610
1614
// Note that if there is a pending claim, but it did not use the
@@ -1620,6 +1624,8 @@ impl<Signer: WriteableEcdsaChannelSigner> ChannelMonitorImpl<Signer> {
1620
1624
return Some ( Balance :: ContentiousClaimable {
1621
1625
claimable_amount_satoshis : htlc. amount_msat / 1000 ,
1622
1626
timeout_height : htlc. cltv_expiry ,
1627
+ payment_hash : htlc. payment_hash ,
1628
+ payment_preimage : * payment_preimage,
1623
1629
} ) ;
1624
1630
}
1625
1631
} else if htlc_resolved. is_none ( ) {
0 commit comments