aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/payments.ts8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/payments.ts b/lib/payments.ts
index 9b7c807b..07048f99 100644
--- a/lib/payments.ts
+++ b/lib/payments.ts
@@ -184,14 +184,12 @@ export const credit = async ({
}) => {
amount = parseInt(amount) || 0;
- let inv;
- if (type === PaymentType.bolt12 && !hash.startsWith("lni")) {
+ let inv = await getInvoice(hash);
+ if (!inv && type === PaymentType.bolt12) {
const { invoices } = await ln.listinvoices({ invstring: hash });
const { local_offer_id } = invoices[0];
inv = await getInvoice(local_offer_id);
- } else {
- inv = await getInvoice(hash);
- }
+ }
if (!inv) {
await db.sAdd("missing", ref.split(":")[0]);