Skip to content

Commit 4fb9a95

Browse files
committed
f Improve and clarify comments
1 parent e42fd9c commit 4fb9a95

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lightning/src/chain/channelmonitor.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ pub(crate) const COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE: u32 = 12;
224224
/// When we go to force-close a channel because an HTLC is expiring, we should ensure that the
225225
/// HTLC(s) expiring are not considered pinnable, allowing us to aggregate them with other HTLC(s)
226226
/// expiring at the same time.
227-
const _HTLCS_NOT_PINNABLE_ON_CLOSE: u32 = CLTV_CLAIM_BUFFER - COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
227+
///
228+
/// This is verified here at compile-time by ensuring the difference is positive.
229+
const _ASSERT_HTLCS_NOT_PINNABLE_ON_CLOSE: u32 = CLTV_CLAIM_BUFFER - COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
228230

229231
/// If an HTLC expires within this many blocks, force-close the channel to broadcast the
230232
/// HTLC-Success transaction.

lightning/src/chain/package.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ impl PackageTemplate {
798798
return false;
799799
}
800800

801-
// First check the types of the inputs and only merge if they are possibly claiming
801+
// First check the types of the inputs and don't merge if they are possibly claiming
802802
// from different commitment transactions at the same time.
803803
// This shouldn't ever happen, but if we do end up with packages trying to claim
804804
// funds from two different commitment transactions (which cannot possibly be
@@ -831,7 +831,7 @@ impl PackageTemplate {
831831
return false;
832832
}
833833

834-
// Now check that we only merge packages if we they are both unpinnable or both
834+
// Now check that we only merge packages if they are both unpinnable or both
835835
// pinnable.
836836
let self_pinnable = self_cluster == AggregationCluster::Pinnable ||
837837
self.counterparty_spendable_height() <= cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;

0 commit comments

Comments
 (0)