Skip to content

Commit 030e531

Browse files
committed
f - Rename remove_cached_invoice
1 parent 9d9b12f commit 030e531

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lightning-invoice/src/payment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,11 +242,11 @@ where
242242
self.payer.retry_payment(&route, payment_id).map_err(|e| PaymentError::Sending(e))
243243
}
244244

245-
/// Removes the [`Invoice`] cached by the given payment hash.
245+
/// Removes the payment cached by the given payment hash.
246246
///
247247
/// Should be called once a payment has failed or succeeded if not using [`InvoicePayer`] as an
248248
/// [`EventHandler`]. Otherwise, calling this method is unnecessary.
249-
pub fn remove_cached_invoice(&self, payment_hash: &PaymentHash) {
249+
pub fn remove_cached_payment(&self, payment_hash: &PaymentHash) {
250250
self.payment_cache.lock().unwrap().remove(payment_hash);
251251
}
252252
}
@@ -627,11 +627,11 @@ mod tests {
627627

628628
// Can repay an invoice once cleared from cache.
629629
let payment_hash = PaymentHash(invoice.payment_hash().clone().into_inner());
630-
invoice_payer.remove_cached_invoice(&payment_hash);
630+
invoice_payer.remove_cached_payment(&payment_hash);
631631
assert!(invoice_payer.pay_invoice(&invoice).is_ok());
632632

633633
// Cannot retry paying an invoice if cleared from cache.
634-
invoice_payer.remove_cached_invoice(&payment_hash);
634+
invoice_payer.remove_cached_payment(&payment_hash);
635635
let event = Event::PaymentPathFailed {
636636
payment_id,
637637
payment_hash,

0 commit comments

Comments
 (0)