Skip to content

Conversation

starius
Copy link
Collaborator

@starius starius commented Oct 11, 2025

Presigned sweeps that produce a change output misreported the on-chain fee. The fee portion was derived from the total swept amount minus only the first transaction output, so any change output was treated as additional fee. Update getFeePortionForSweep to subtract the value of every tx output so the fee portion reflects only the actual miner fee paid. Add regression coverage that sweeps a presigned input with change and asserts the spend and confirmation notifications report the corrected fee.

Pull Request Checklist

  • Update release_notes.md if your PR contains major features, breaking changes or bugfixes

Presigned sweeps that produce a change output misreported the on-chain fee.
The fee portion was derived from the total swept amount minus only the
first transaction output, so any change output was treated as additional fee.
Update getFeePortionForSweep to subtract the value of every tx output so
the fee portion reflects only the actual miner fee paid. Add regression
coverage that sweeps a presigned input with change and asserts the spend
and confirmation notifications report the corrected fee.
@starius starius force-pushed the sweepbatcher-change-outputs-fees-fix branch from 006bb53 to a5871d6 Compare October 11, 2025 18:21
@starius starius marked this pull request as ready for review October 11, 2025 18:41
We forgot to account for change outputs when checking the feerate of
signed transaction. The bug resulted in fee rate overestimation in the
log message.
Copy link
Member

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! 🎉

Copy link
Collaborator

@hieblmi hieblmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@starius starius merged commit 4458577 into lightninglabs:master Oct 13, 2025
11 of 12 checks passed
@starius starius deleted the sweepbatcher-change-outputs-fees-fix branch October 13, 2025 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants