Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

When using the normal default constructors, we should have some
fee maximum to ensure our default behavior is safe. Here we pick
1% + 50 sats to ensure we're always willing to pay
reasonabl(y high) fees, but not anything too wild.

When using the normal default constructors, we should have some
fee maximum to ensure our default behavior is safe. Here we pick
1% + 50 sats to ensure we're always willing to pay
reasonabl(y high) fees, but not anything too wild.
@TheBlueMatt TheBlueMatt added this to the 0.0.117 milestone Sep 26, 2023
/// [`Self::max_total_routing_fee_msat`] defaults to 1% of the payment amount + 50 sats
pub fn from_payment_params_and_value(payment_params: PaymentParameters, final_value_msat: u64) -> Self {
Self { payment_params, final_value_msat, max_total_routing_fee_msat: None }
Self { payment_params, final_value_msat, max_total_routing_fee_msat: Some(final_value_msat / 100 + 50_000) }
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we set this in OutboundPayments::create_pending_payment instead of here? That currently sets a default if not set.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hmm, I don't see any default being set there? It just does a route_params...and_then which will leave it as None if the original was None.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, right. I misread that. Would it make more sense to set it there, though, rather than modifying the RouteParameters upon construction? I guess not as the user wouldn't be able to pass None then.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yea, I think better to do it on construction so that its there from the start and the user sees it when/if/before they override.

@codecov-commenter
Copy link

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (1ac53ed) 88.84% compared to head (0c31c6f) 88.83%.
Report is 4 commits behind head on main.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2603      +/-   ##
==========================================
- Coverage   88.84%   88.83%   -0.01%     
==========================================
  Files         113      113              
  Lines       84729    84749      +20     
  Branches    84729    84749      +20     
==========================================
+ Hits        75275    75289      +14     
- Misses       7240     7244       +4     
- Partials     2214     2216       +2     
Files Coverage Δ
lightning/src/ln/outbound_payment.rs 88.91% <100.00%> (+0.01%) ⬆️
lightning/src/ln/payment_tests.rs 98.12% <100.00%> (-0.03%) ⬇️
lightning/src/routing/router.rs 93.47% <76.47%> (-0.05%) ⬇️

... and 9 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TheBlueMatt TheBlueMatt merged commit c8e1916 into lightningdevkit:main Sep 27, 2023
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.

4 participants