@@ -71,10 +71,8 @@ impl Bolt11Payment {
71
71
72
72
/// Send a payment given an invoice.
73
73
///
74
- /// If [`SendingParameters`] are provided they will override the node's default routing parameters
75
- /// on a per-field basis. Each field in `SendingParameters` that is set replaces the corresponding
76
- /// default value. Fields that are not set fall back to the node's configured defaults. If no
77
- /// `SendingParameters` are provided, the method fully relies on these defaults.
74
+ /// If `sending_parameters` are provided they will override the default as well as the
75
+ /// node-wide parameters configured via [`Config::sending_parameters`] on a per-field basis.
78
76
pub fn send (
79
77
& self , invoice : & Bolt11Invoice , sending_parameters : Option < SendingParameters > ,
80
78
) -> Result < PaymentId , Error > {
@@ -99,9 +97,7 @@ impl Bolt11Payment {
99
97
}
100
98
101
99
if let Some ( user_set_params) = sending_parameters {
102
- if let Some ( mut default_params) =
103
- self . config . sending_parameters_config . as_ref ( ) . cloned ( )
104
- {
100
+ if let Some ( mut default_params) = self . config . sending_parameters . as_ref ( ) . cloned ( ) {
105
101
default_params. max_total_routing_fee_msat = user_set_params
106
102
. max_total_routing_fee_msat
107
103
. or ( default_params. max_total_routing_fee_msat ) ;
@@ -122,7 +118,7 @@ impl Bolt11Payment {
122
118
route_params. payment_params . max_channel_saturation_power_of_half =
123
119
default_params. max_channel_saturation_power_of_half . unwrap_or_default ( ) ;
124
120
}
125
- } else if let Some ( default_params) = & self . config . sending_parameters_config {
121
+ } else if let Some ( default_params) = & self . config . sending_parameters {
126
122
route_params. max_total_routing_fee_msat = default_params. max_total_routing_fee_msat ;
127
123
route_params. payment_params . max_total_cltv_expiry_delta =
128
124
default_params. max_total_cltv_expiry_delta . unwrap_or_default ( ) ;
@@ -197,10 +193,8 @@ impl Bolt11Payment {
197
193
/// This can be used to pay a so-called "zero-amount" invoice, i.e., an invoice that leaves the
198
194
/// amount paid to be determined by the user.
199
195
///
200
- /// If [`SendingParameters`] are provided they will override the node's default routing parameters
201
- /// on a per-field basis. Each field in `SendingParameters` that is set replaces the corresponding
202
- /// default value. Fields that are not set fall back to the node's configured defaults. If no
203
- /// `SendingParameters` are provided, the method fully relies on these defaults.
196
+ /// If `sending_parameters` are provided they will override the default as well as the
197
+ /// node-wide parameters configured via [`Config::sending_parameters`] on a per-field basis.
204
198
pub fn send_using_amount (
205
199
& self , invoice : & Bolt11Invoice , amount_msat : u64 ,
206
200
sending_parameters : Option < SendingParameters > ,
@@ -248,9 +242,7 @@ impl Bolt11Payment {
248
242
RouteParameters :: from_payment_params_and_value ( payment_params, amount_msat) ;
249
243
250
244
if let Some ( user_set_params) = sending_parameters {
251
- if let Some ( mut default_params) =
252
- self . config . sending_parameters_config . as_ref ( ) . cloned ( )
253
- {
245
+ if let Some ( mut default_params) = self . config . sending_parameters . as_ref ( ) . cloned ( ) {
254
246
default_params. max_total_routing_fee_msat = user_set_params
255
247
. max_total_routing_fee_msat
256
248
. or ( default_params. max_total_routing_fee_msat ) ;
@@ -271,7 +263,7 @@ impl Bolt11Payment {
271
263
route_params. payment_params . max_channel_saturation_power_of_half =
272
264
default_params. max_channel_saturation_power_of_half . unwrap_or_default ( ) ;
273
265
}
274
- } else if let Some ( default_params) = & self . config . sending_parameters_config {
266
+ } else if let Some ( default_params) = & self . config . sending_parameters {
275
267
route_params. max_total_routing_fee_msat = default_params. max_total_routing_fee_msat ;
276
268
route_params. payment_params . max_total_cltv_expiry_delta =
277
269
default_params. max_total_cltv_expiry_delta . unwrap_or_default ( ) ;
0 commit comments