fix: bug unable confirm invoice (#204)

* chore: confirm only if bolt11 is present

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>

* fix: fix double invoice bug. thx mazin

* fix: fypo tix on default-settings

* fix: use correct dbname on knexfile

---------

Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
Ricardo Arturo Cabral Mejía 2023-02-14 23:41:09 -05:00 committed by GitHub
parent d9856589e5
commit bcd072efcd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 5 deletions

View File

@ -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',

View File

@ -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:

View File

@ -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) {

View File

@ -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')