Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PushAmount trait to track the reason behind a push #2846

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

t-bast
Copy link
Member

@t-bast t-bast commented Mar 29, 2024

We have the ability to push some funds to our peer when opening a channel or splicing. This is generally used between LSPs and wallets to pay fees for on-the-fly funding, but can also be used for many other reasons.

We introduce a dedicated trait for that field instead of using a plain amount: that allows carrying more data than just an amount, and provides better insights of why some funds were pushed.

This is purely a refactoring at that point, without any logical changes.

NB: this builds on top of #2845

The channel initiator traditionnally pays the commit tx fees, but we may
want to override that when providing services to wallet users. We thus
split the current `isInitiator` flag into two flags:

- `isChannelOpener`
- `payCommitTxFees`

We always set `payCommitTxFees` to the same value as `isChannelOpener`.
Custom feature bits may override that behavior if necessary.

Note that backwards compatibity is preserved since our previous `bool8`
codec encodes `true` as `0xff` and `false` as `0x00`.
We have the ability to push some funds to our peer when opening a
channel or splicing. This is generally used between LSPs and wallets
to pay fees for on-the-fly funding, but can also be used for many other
reasons.

We introduce a dedicated trait for that field instead of using a plain
amount: that allows carrying more data than just an amount, and provides
better insights of why some funds were pushed.

This is purely a refactoring at that point, without any logical changes.
@t-bast t-bast requested a review from pm47 March 29, 2024 16:06
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.

None yet

1 participant