mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-17 13:21:45 +01:00
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:
parent
d9856589e5
commit
bcd072efcd
@ -5,7 +5,7 @@ module.exports = {
|
|||||||
port: process.env.DB_PORT ?? 5432,
|
port: process.env.DB_PORT ?? 5432,
|
||||||
user: process.env.DB_USER ?? 'postgres',
|
user: process.env.DB_USER ?? 'postgres',
|
||||||
password: process.env.DB_PASSWORD ?? 'postgres',
|
password: process.env.DB_PASSWORD ?? 'postgres',
|
||||||
database: process.env.DB_NAME ?? 'nostr-ts-relay',
|
database: process.env.DB_NAME ?? 'nostream',
|
||||||
},
|
},
|
||||||
seeds: {
|
seeds: {
|
||||||
directory: './seeds',
|
directory: './seeds',
|
||||||
|
@ -10,7 +10,7 @@ payments:
|
|||||||
feeSchedules:
|
feeSchedules:
|
||||||
admission:
|
admission:
|
||||||
- enabled: false
|
- 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
|
amount: 1000000
|
||||||
whitelists:
|
whitelists:
|
||||||
pubkeys:
|
pubkeys:
|
||||||
|
@ -26,7 +26,7 @@ export class ZebedeeCallbackController implements IController {
|
|||||||
debug('invoice', invoice)
|
debug('invoice', invoice)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if (!invoice.bolt11) {
|
if (invoice.bolt11) {
|
||||||
await this.paymentsService.updateInvoice(invoice)
|
await this.paymentsService.updateInvoice(invoice)
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
@ -124,9 +124,9 @@ export class PostInvoiceController implements IController {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
const minBalance = currentSettings.limits?.event?.pubkey?.minBalance ?? 0n
|
const minBalance = currentSettings.limits?.event?.pubkey?.minBalance
|
||||||
const user = await this.userRepository.findByPubkey(pubkey)
|
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
|
response
|
||||||
.status(400)
|
.status(400)
|
||||||
.setHeader('content-type', 'text/plain; charset=utf8')
|
.setHeader('content-type', 'text/plain; charset=utf8')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user