Repository navigation
Reject LSPS2 fees above payment amounts #1172
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -93,14 +93,14 @@ where | |
| Error::LiquidityRequestFailed | ||
| })?; | ||
|
|
||
| if let Some(max_total_lsp_fee_limit_msat) = max_total_lsp_fee_limit_msat { | ||
| if min_total_fee_msat > max_total_lsp_fee_limit_msat { | ||
| log_error!(self.logger, | ||
| "Failed to request inbound JIT channel as LSP's requested total opening fee of {}msat exceeds our fee limit of {}msat", | ||
| min_total_fee_msat, max_total_lsp_fee_limit_msat | ||
| ); | ||
| return Err(Error::LiquidityFeeTooHigh); | ||
| } | ||
| let max_total_lsp_fee_limit_msat = | ||
| max_total_lsp_fee_limit_msat.unwrap_or(amount_msat).min(amount_msat); | ||
|
tnull marked this conversation as resolved.
|
||
| if min_total_fee_msat > max_total_lsp_fee_limit_msat { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This allows So Should this be
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, we're more liberal what we accept here. No, this is intentional
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. |
||
| log_error!(self.logger, | ||
| "Failed to request inbound JIT channel as LSP's requested total opening fee of {}msat exceeds our fee limit of {}msat", | ||
| min_total_fee_msat, max_total_lsp_fee_limit_msat | ||
| ); | ||
| return Err(Error::LiquidityFeeTooHigh); | ||
| } | ||
|
|
||
| log_debug!( | ||
|
|
@@ -110,18 +110,18 @@ where | |
| min_total_fee_msat | ||
| ); | ||
|
|
||
| let lsps2_parameters = LSPS2Parameters { | ||
| max_total_opening_fee_msat: Some(min_total_fee_msat), | ||
| max_proportional_opening_fee_ppm_msat: None, | ||
| min_opening_fee_msat: min_opening_params.min_fee_msat, | ||
| }; | ||
| let buy_response = self | ||
| .lsps2_send_buy_request( | ||
| Some(amount_msat), | ||
| min_opening_params, | ||
| Some(&cheapest_lsp.node_id), | ||
| ) | ||
| .await?; | ||
| let lsps2_parameters = LSPS2Parameters { | ||
| max_total_opening_fee_msat: Some(min_total_fee_msat), | ||
| max_proportional_opening_fee_ppm_msat: None, | ||
| }; | ||
|
|
||
| let invoice = self.lsps2_create_jit_invoice( | ||
| buy_response, | ||
| Some(amount_msat), | ||
|
|
@@ -178,13 +178,14 @@ where | |
| min_prop_fee_ppm_msat | ||
| ); | ||
|
|
||
| let buy_response = self | ||
| .lsps2_send_buy_request(None, min_opening_params, Some(&cheapest_lsp.node_id)) | ||
| .await?; | ||
| let lsps2_parameters = LSPS2Parameters { | ||
| max_total_opening_fee_msat: None, | ||
| max_proportional_opening_fee_ppm_msat: Some(min_prop_fee_ppm_msat), | ||
| min_opening_fee_msat: min_opening_params.min_fee_msat, | ||
| }; | ||
| let buy_response = self | ||
| .lsps2_send_buy_request(None, min_opening_params, Some(&cheapest_lsp.node_id)) | ||
| .await?; | ||
| let invoice = self.lsps2_create_jit_invoice( | ||
| buy_response, | ||
| None, | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.