Skip to content

Conversation

@Anyitechs
Copy link
Contributor

This PR introduces the ability to set SendingParameters in BOLT11 and BOLT12 send methods.

Closes #4

@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Dec 9, 2025

👋 Thanks for assigning @benthecarman as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@Anyitechs Anyitechs force-pushed the introduce-SendingParameters branch from 19da5dd to 96842d2 Compare December 9, 2025 13:08
@tnull tnull requested review from benthecarman and removed request for valentinewallace December 9, 2025 13:55
Comment on lines 191 to 195
max_total_cltv_expiry_delta: max_total_cltv_expiry_delta.unwrap_or_default(),
max_path_count: max_path_count.unwrap_or_default(),
max_channel_saturation_power_of_half: max_channel_saturation_power_of_half
.unwrap_or_default(),
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't use unwrap_or_default here, it will set each of these to 0 and not give the user what they expect. Instead you should be setting these to RouteParametersConfig's default value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, thank you.

Comment on lines 230 to 233
max_total_cltv_expiry_delta: max_total_cltv_expiry_delta.unwrap_or_default(),
max_path_count: max_path_count.unwrap_or_default(),
max_channel_saturation_power_of_half: max_channel_saturation_power_of_half
.unwrap_or_default(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Comment on lines 695 to 699
// Defaults to [`DEFAULT_MAX_TOTAL_CLTV_EXPIRY_DELTA`].
uint32 max_total_cltv_expiry_delta = 2;

// The maximum number of paths that may be used by (MPP) payments.
// Defaults to [`DEFAULT_MAX_PATH_COUNT`].
Copy link
Collaborator

Choose a reason for hiding this comment

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

The defaults to text here won't really work because it'll put the constant but not actually render/fetch the value. Will need to just put the actual value here sadly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Comment on lines 19 to 20
max_path_count: params.max_path_count as u8,
max_channel_saturation_power_of_half: params.max_channel_saturation_power_of_half as u8,
Copy link
Collaborator

Choose a reason for hiding this comment

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

since we are going down from u32 to u8, this isn't really safe. we should use try_into here so we can properly handle overflows

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

let route_parameters = request.route_parameters.map(|params| RouteParametersConfig {
max_total_routing_fee_msat: params.max_total_routing_fee_msat,
max_total_cltv_expiry_delta: params.max_total_cltv_expiry_delta,
max_path_count: params.max_path_count as u8,
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Copy link
Collaborator

@benthecarman benthecarman left a comment

Choose a reason for hiding this comment

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

lgtm! can you squash your commits though

@Anyitechs Anyitechs force-pushed the introduce-SendingParameters branch from a8de0d1 to ebb776d Compare December 11, 2025 11:47
@Anyitechs
Copy link
Contributor Author

can you squash your commits though

Done. Squashed fixups with no further changes.

@benthecarman benthecarman merged commit 48a02e5 into lightningdevkit:main Dec 11, 2025
7 checks passed
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.

Allow to set SendingParameters in BOLT11 & BOLT12 send

3 participants