Skip to content

Commit ad4f16b

Browse files
committed
Add InvoicePayer for retrying failed payments
When a payment fails, it's useful to retry the payment once the network graph and channel scores are updated. InvoicePayer is a utility for making payments which will retry any failed payment paths for a payment up to a configured number of total attempts. It is parameterized by a Payer and Router for ease of customization and testing. Implement EventHandler for InvoicePayer as a decorator that intercepts PaymentPathFailed events and retries that payment using the parameters from the event. It delegates to the decorated EventHandler after retries have been exhausted and for other events.
1 parent 2d102a3 commit ad4f16b

File tree

3 files changed

+856
-2
lines changed

3 files changed

+856
-2
lines changed

lightning-invoice/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@
1515
//! * For parsing use `str::parse::<Invoice>(&self)` (see the docs of `impl FromStr for Invoice`)
1616
//! * For constructing invoices use the `InvoiceBuilder`
1717
//! * For serializing invoices use the `Display`/`ToString` traits
18+
pub mod payment;
1819
pub mod utils;
1920

2021
extern crate bech32;
2122
extern crate bitcoin_hashes;
22-
extern crate lightning;
23+
#[macro_use] extern crate lightning;
2324
extern crate num_traits;
2425
extern crate secp256k1;
2526

0 commit comments

Comments
 (0)