Skip to content

Commit e93622b

Browse files
committed
Drop counterparty_spendable_height accessor
`counterparty_spendable_height` is not used outside of `package.rs` so there's not much reason to have an accessor for it. Also, in the next commit an issue with setting the correct value for revoked counterparty HTLC outputs is fixed, and the upgrade path causes the value to be 0 in some cases, making using the value in too many places somewhat fraught.
1 parent 79267d3 commit e93622b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

lightning/src/chain/package.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -834,17 +834,17 @@ impl PackageTemplate {
834834
// Now check that we only merge packages if they are both unpinnable or both
835835
// pinnable.
836836
let self_pinnable = self_cluster == AggregationCluster::Pinnable ||
837-
self.counterparty_spendable_height() <= cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
837+
self.counterparty_spendable_height <= cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
838838
let other_pinnable = other_cluster == AggregationCluster::Pinnable ||
839-
other.counterparty_spendable_height() <= cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
839+
other.counterparty_spendable_height <= cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
840840
if self_pinnable && other_pinnable {
841841
return true;
842842
}
843843

844844
let self_unpinnable = self_cluster == AggregationCluster::Unpinnable &&
845-
self.counterparty_spendable_height() > cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
845+
self.counterparty_spendable_height > cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
846846
let other_unpinnable = other_cluster == AggregationCluster::Unpinnable &&
847-
other.counterparty_spendable_height() > cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
847+
other.counterparty_spendable_height > cur_height + COUNTERPARTY_CLAIMABLE_WITHIN_BLOCKS_PINNABLE;
848848
if self_unpinnable && other_unpinnable {
849849
return true;
850850
}
@@ -855,13 +855,6 @@ impl PackageTemplate {
855855
pub(crate) fn is_malleable(&self) -> bool {
856856
matches!(self.malleability, PackageMalleability::Malleable(..))
857857
}
858-
/// The height at which our counterparty may be able to spend this output.
859-
///
860-
/// This is an important limit for aggregation as after this height our counterparty may be
861-
/// able to pin transactions spending this output in the mempool.
862-
pub(crate) fn counterparty_spendable_height(&self) -> u32 {
863-
self.counterparty_spendable_height
864-
}
865858
pub(crate) fn previous_feerate(&self) -> u64 {
866859
self.feerate_previous
867860
}

0 commit comments

Comments
 (0)