aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2025-09-20 04:05:44 +0000
committerAdam Soltys <[email protected]>2025-09-20 04:05:44 +0000
commit77f6dcea1148f33737f5c772e42bc1c5a12b5be1 (patch)
tree4c740af266a4e77cbd69a95a43e40d21106f8220
parentf9c8a7694e11b48f92ba423a571861839f54d8d4 (diff)
downloadcoinos-server-77f6dcea1148f33737f5c772e42bc1c5a12b5be1.tar.gz
coinos-server-77f6dcea1148f33737f5c772e42bc1c5a12b5be1.zip
fix bolt12 issue
-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]);