This function was very confusing - its used to determine by when
we have to stop aggregating this claim with others as it starts to
be at risk of pinning due to the counterparty's ability to spend
the output.
It is not ever used as a timelock for a transaction, and thus its
name is very confusing.
Instead we rename it `counterparty_spendable_height`.
continue;
}
- log_trace!(logger, "Test if outpoint can be aggregated with expiration {} against {}", req.timelock(), cur_height + CLTV_SHARED_CLAIM_BUFFER);
- if req.timelock() <= cur_height + CLTV_SHARED_CLAIM_BUFFER || !req.aggregable() {
- // Don't aggregate if outpoint package timelock is soon or marked as non-aggregable
+ log_trace!(logger, "Test if outpoint which our counterparty can spend at {} can be aggregated based on aggregation limit {}", req.counterparty_spendable_height(), cur_height + CLTV_SHARED_CLAIM_BUFFER);
+ if req.counterparty_spendable_height() <= cur_height + CLTV_SHARED_CLAIM_BUFFER || !req.aggregable() {
preprocessed_requests.push(req);
} else if aggregated_request.is_none() {
aggregated_request = Some(req);
pub(crate) fn is_malleable(&self) -> bool {
self.malleability == PackageMalleability::Malleable
}
- pub(crate) fn timelock(&self) -> u32 {
+ /// The height at which our counterparty may be able to spend this output.
+ ///
+ /// This is an important limit for aggregation as after this height our counterparty may be
+ /// able to pin transactions spending this output in the mempool.
+ pub(crate) fn counterparty_spendable_height(&self) -> u32 {
self.soonest_conf_deadline
}
pub(crate) fn aggregable(&self) -> bool {