Skip to content

Conversation

f321x
Copy link
Member

@f321x f321x commented Jul 31, 2025

If the tx fee of the ctx is already higher than the required target it is not useful to spend the anchor so instead it is skipped.

As a side effect the closing tx is not shown in the history anymore until any output got claimed, only the lightning part of the closing group is shown, but the closing tx can be found in the channel details:
image
This is because sweep_commitment_transaction only adds the anchor and to_local outputs to the accounting addresses once there is a (nonlocal) spending tx, so it is missed by get_onchain_history(), same issue(?) for SRK channels. However only declaring them "accounting address" after the sweep seems intentional:

self._accounting_addresses = set() # addresses counted as ours after successful sweep

@f321x f321x force-pushed the anchor_output_sweeping_lower_fee branch 2 times, most recently from 5a65984 to bcea3eb Compare August 4, 2025 14:58
If the tx fee of the ctx is already higher than the required target it
is not useful to spend the anchor with a lower fee (the current target),
so instead it is skipped.
Adds unittest for `TxBatch._to_sweep_after()` anchor claiming part.

# Conflicts:
#	tests/test_txbatcher.py
@f321x f321x force-pushed the anchor_output_sweeping_lower_fee branch from bcea3eb to 27603e9 Compare September 1, 2025 10:12
@f321x f321x changed the title txbatcher: don't spend anchors if ctx fee is sufficient already txbatcher: don't spend anchors if ctx fee is already sufficient Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant