Skip to content

Commit bcd072e

Browse files
authored
fix: bug unable confirm invoice (#204)
* chore: confirm only if bolt11 is present Signed-off-by: Ricardo Arturo Cabral Mejía <[email protected]> * 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 <[email protected]>
1 parent d985658 commit bcd072e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

knexfile.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ module.exports = {
55
port: process.env.DB_PORT ?? 5432,
66
user: process.env.DB_USER ?? 'postgres',
77
password: process.env.DB_PASSWORD ?? 'postgres',
8-
database: process.env.DB_NAME ?? 'nostr-ts-relay',
8+
database: process.env.DB_NAME ?? 'nostream',
99
},
1010
seeds: {
1111
directory: './seeds',

resources/default-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ payments:
1010
feeSchedules:
1111
admission:
1212
- enabled: false
13-
descripton: Admission fee charged per public key in msats (1000 msats = 1 satoshi)
13+
description: Admission fee charged per public key in msats (1000 msats = 1 satoshi)
1414
amount: 1000000
1515
whitelists:
1616
pubkeys:

src/controllers/callbacks/zebedee-callback-controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export class ZebedeeCallbackController implements IController {
2626
debug('invoice', invoice)
2727

2828
try {
29-
if (!invoice.bolt11) {
29+
if (invoice.bolt11) {
3030
await this.paymentsService.updateInvoice(invoice)
3131
}
3232
} catch (error) {

src/controllers/invoices/post-invoice-controller.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ export class PostInvoiceController implements IController {
124124
return
125125
}
126126

127-
const minBalance = currentSettings.limits?.event?.pubkey?.minBalance ?? 0n
127+
const minBalance = currentSettings.limits?.event?.pubkey?.minBalance
128128
const user = await this.userRepository.findByPubkey(pubkey)
129-
if (user && user.isAdmitted && minBalance > 0n && user.balance >= minBalance) {
129+
if (user && user.isAdmitted && (!minBalance || user.balance >= minBalance)) {
130130
response
131131
.status(400)
132132
.setHeader('content-type', 'text/plain; charset=utf8')

0 commit comments

Comments
 (0)