Skip to content

Commit 8a56702

Browse files
committed
Add internal docs for ChannelMonitor::payment_preimages
1 parent a12d37e commit 8a56702

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

lightning/src/chain/channelmonitor.rs

+4
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,10 @@ pub(crate) struct ChannelMonitorImpl<Signer: Sign> {
655655
// deserialization
656656
current_holder_commitment_number: u64,
657657

658+
/// The set of payment hashes from inbound payments for which we know the preimage. Payment
659+
/// preimages that are not included in any unrevoked local commitment transaction or unrevoked
660+
/// remote commitment transactions are automatically removed when commitment transactions are
661+
/// revoked.
658662
payment_preimages: HashMap<PaymentHash, PaymentPreimage>,
659663

660664
// Note that `MonitorEvent`s MUST NOT be generated during update processing, only generated

lightning/src/ln/channel.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1703,11 +1703,11 @@ impl<Signer: Sign> Channel<Signer> {
17031703
make_funding_redeemscript(&self.get_holder_pubkeys().funding_pubkey, self.counterparty_funding_pubkey())
17041704
}
17051705

1706-
/// Claims an HTLC while we're disconnected from a peer, dropping the ChannelMonitorUpdate
1706+
/// Claims an HTLC while we're disconnected from a peer, dropping the [`ChannelMonitorUpdate`]
17071707
/// entirely.
17081708
///
1709-
/// The ChannelMonitor for this channel MUST be updated out-of-band with the preimage provided
1710-
/// (i.e. without calling [`crate::chain::Watch::update_channel`]).
1709+
/// The [`ChannelMonitor`] for this channel MUST be updated out-of-band with the preimage
1710+
/// provided (i.e. without calling [`crate::chain::Watch::update_channel`]).
17111711
///
17121712
/// The HTLC claim will end up in the holding cell (because the caller must ensure the peer is
17131713
/// disconnected).

lightning/src/ln/channelmanager.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,9 @@ pub(super) struct ChannelHolder<Signer: Sign> {
414414
/// guarantees are made about the existence of a channel with the short id here, nor the short
415415
/// ids in the PendingHTLCInfo!
416416
pub(super) forward_htlcs: HashMap<u64, Vec<HTLCForwardInfo>>,
417-
/// Map from payment hash to any HTLCs which are to us and can be failed/claimed by the user.
417+
/// Map from payment hash to the payment data and any HTLCs which are to us and can be
418+
/// failed/claimed by the user.
419+
///
418420
/// Note that while this is held in the same mutex as the channels themselves, no consistency
419421
/// guarantees are made about the channels given here actually existing anymore by the time you
420422
/// go to read them!

0 commit comments

Comments
 (0)