@@ -175,6 +175,10 @@ pub trait Router<S: routing::Score> {
175
175
}
176
176
177
177
/// Number of attempts to retry payment path failures for an [`Invoice`].
178
+ ///
179
+ /// Note that this is the number of *path* failures, not full payment retries. For multi-path
180
+ /// payments, if this is less than the total number of paths, we will never even retry all of the
181
+ /// payment's paths.
178
182
#[ derive( Clone , Copy , Debug , Eq , Hash , PartialEq ) ]
179
183
pub struct RetryAttempts ( pub usize ) ;
180
184
@@ -216,6 +220,10 @@ where
216
220
}
217
221
218
222
/// Pays the given [`Invoice`], caching it for later use in case a retry is needed.
223
+ ///
224
+ /// You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
225
+ /// never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
226
+ /// for you.
219
227
pub fn pay_invoice ( & self , invoice : & Invoice ) -> Result < PaymentId , PaymentError > {
220
228
if invoice. amount_milli_satoshis ( ) . is_none ( ) {
221
229
Err ( PaymentError :: Invoice ( "amount missing" ) )
@@ -226,6 +234,10 @@ where
226
234
227
235
/// Pays the given zero-value [`Invoice`] using the given amount, caching it for later use in
228
236
/// case a retry is needed.
237
+ ///
238
+ /// You should ensure that the `invoice.payment_hash()` is unique and the same payment_hash has
239
+ /// never been paid before. Because [`InvoicePayer`] is stateless no effort is made to do so
240
+ /// for you.
229
241
pub fn pay_zero_value_invoice (
230
242
& self , invoice : & Invoice , amount_msats : u64
231
243
) -> Result < PaymentId , PaymentError > {
0 commit comments