-
Notifications
You must be signed in to change notification settings - Fork 418
[Custom Transactions] Add TxBuilder::get_available_balances
#4026
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
base: main
Are you sure you want to change the base?
Conversation
👋 Thanks for assigning @TheBlueMatt as a reviewer! |
@TheBlueMatt would appreciate a high-level design pass on this one thank you. I largely just move |
lightning/src/sign/tx_builder.rs
Outdated
fn get_available_balances( | ||
&self, is_outbound_from_holder: bool, channel_value_satoshis: u64, | ||
value_to_holder_msat: u64, pending_htlcs: &[HTLCAmountDirection], feerate_per_kw: u32, | ||
dust_exposure_limiting_feerate: Option<u32>, max_dust_htlc_exposure_msat: u64, | ||
holder_channel_constraints: ChannelConstraints, | ||
counterparty_channel_constraints: ChannelConstraints, channel_type: &ChannelTypeFeatures, | ||
) -> crate::ln::channel::AvailableBalances; | ||
fn get_next_commitment_stats( | ||
&self, local: bool, is_outbound_from_holder: bool, channel_value_satoshis: u64, | ||
value_to_holder_msat: u64, next_commitment_htlcs: &[HTLCAmountDirection], | ||
addl_nondust_htlc_count: usize, feerate_per_kw: u32, | ||
dust_exposure_limiting_feerate: Option<u32>, broadcaster_dust_limit_satoshis: u64, | ||
channel_type: &ChannelTypeFeatures, | ||
) -> NextCommitmentStats; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking we'll want to merge these two into one :)
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4026 +/- ##
========================================
Coverage 88.76% 88.77%
========================================
Files 176 176
Lines 128139 127983 -156
Branches 128139 127983 -156
========================================
- Hits 113743 113613 -130
+ Misses 11822 11794 -28
- Partials 2574 2576 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused, I was under the impression we were going to pause the custom tx builder work for a month or two after landing #3921?
👋 The first review has been submitted! Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer. |
Agreed yes this doesn't have to land anytime soon - I still wanted to get this PR out of my head and written before I stop |
This will make our lives easier when we use `get_next_commitment_stats` to determine the available balances in the channel.
No functional change.
These will be useful to pass these constraints to `TxBuilder` to calculate `AvailableBalances`.
Also move things around to make the move in the next commit as straightforward as possible. We take the conservative route here and include all pending HTLCs, including those in the holding cell, no matter their state.
Besides the changes in the `TxBuilder` API, this is a code move.
Depends on #3921