From b6dc2a8f0022a83ed0dfd21470557691b7077202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Tue, 14 Feb 2023 22:09:03 -0500 Subject: [PATCH 1/4] chore: confirm only if bolt11 is present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ricardo Arturo Cabral Mejía --- src/controllers/callbacks/zebedee-callback-controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controllers/callbacks/zebedee-callback-controller.ts b/src/controllers/callbacks/zebedee-callback-controller.ts index be54e9c9b..9320676f3 100644 --- a/src/controllers/callbacks/zebedee-callback-controller.ts +++ b/src/controllers/callbacks/zebedee-callback-controller.ts @@ -26,7 +26,7 @@ export class ZebedeeCallbackController implements IController { debug('invoice', invoice) try { - if (!invoice.bolt11) { + if (invoice.bolt11) { await this.paymentsService.updateInvoice(invoice) } } catch (error) { From b03a692999f1eae26b21cb2b62e8904eb69f6b10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Tue, 14 Feb 2023 22:22:06 -0500 Subject: [PATCH 2/4] fix: fix double invoice bug. thx mazin --- src/controllers/invoices/post-invoice-controller.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/controllers/invoices/post-invoice-controller.ts b/src/controllers/invoices/post-invoice-controller.ts index 0065ef4a6..981f5a128 100644 --- a/src/controllers/invoices/post-invoice-controller.ts +++ b/src/controllers/invoices/post-invoice-controller.ts @@ -124,9 +124,9 @@ export class PostInvoiceController implements IController { return } - const minBalance = currentSettings.limits?.event?.pubkey?.minBalance ?? 0n + const minBalance = currentSettings.limits?.event?.pubkey?.minBalance const user = await this.userRepository.findByPubkey(pubkey) - if (user && user.isAdmitted && minBalance > 0n && user.balance >= minBalance) { + if (user && user.isAdmitted && (!minBalance || user.balance >= minBalance)) { response .status(400) .setHeader('content-type', 'text/plain; charset=utf8') From 50df4928b17f52803440ae050e0f370ddbfeb802 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Tue, 14 Feb 2023 23:10:21 -0500 Subject: [PATCH 3/4] fix: fypo tix on default-settings --- resources/default-settings.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/default-settings.yaml b/resources/default-settings.yaml index 62bd4c4ed..4351fd8d2 100755 --- a/resources/default-settings.yaml +++ b/resources/default-settings.yaml @@ -10,7 +10,7 @@ payments: feeSchedules: admission: - enabled: false - descripton: Admission fee charged per public key in msats (1000 msats = 1 satoshi) + description: Admission fee charged per public key in msats (1000 msats = 1 satoshi) amount: 1000000 whitelists: pubkeys: From 307ccceb023407d5200432a2c2129836ab828fa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Arturo=20Cabral=20Mej=C3=ADa?= Date: Tue, 14 Feb 2023 23:10:48 -0500 Subject: [PATCH 4/4] fix: use correct dbname on knexfile --- knexfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/knexfile.js b/knexfile.js index 6546cc42d..955437370 100644 --- a/knexfile.js +++ b/knexfile.js @@ -5,7 +5,7 @@ module.exports = { port: process.env.DB_PORT ?? 5432, user: process.env.DB_USER ?? 'postgres', password: process.env.DB_PASSWORD ?? 'postgres', - database: process.env.DB_NAME ?? 'nostr-ts-relay', + database: process.env.DB_NAME ?? 'nostream', }, seeds: { directory: './seeds',