Fail payment retry if Invoice is expired
authorJeffrey Czyz <jkczyz@gmail.com>
Thu, 30 Sep 2021 18:30:24 +0000 (11:30 -0700)
committerJeffrey Czyz <jkczyz@gmail.com>
Wed, 27 Oct 2021 15:54:53 +0000 (10:54 -0500)
commitd9b9916601cf688dabb0ad4dcddcb98c4c8467e5
tree2af9df03b3c83fb09570178ede0d532f4949ffc4
parente523e581522e3c1e1a13a79f339931b5662ca13f
Fail payment retry if Invoice is expired

According to BOLT 11:

- after the `timestamp` plus `expiry` has passed
  - SHOULD NOT attempt a payment

Add a convenience method for checking if an Invoice has expired, and use
it to short-circuit payment retries.
lightning-invoice/src/lib.rs
lightning-invoice/src/payment.rs
lightning/src/routing/router.rs