Compare commits

..

3 commits

Author SHA1 Message Date
51a5adf540 feat: implement automatic crediting of new accounts with 1 million satoshis
- Modified the user account creation process to automatically credit new
accounts with 1,000,000 satoshis upon creation.
- Updated the `create_user_account_no_ckeck` function to include error
handling and logging for the credit operation.
- Enhanced tests to verify the balance for newly registered users,
ensuring the correct credit amount is applied.
- Documented affected account creation paths and testing instructions in
the new `AUTO_CREDIT_CHANGES.md` file.

fix: pass db connection to update_wallet_balance to prevent SQLite deadlock

The auto-credit feature was causing a deadlock on SQLite because
update_wallet_balance was opening a new database connection while
already inside a transaction. By passing conn=conn, we reuse the
existing connection and avoid the deadlock.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 02:51:37 +01:00
85c7e13a27 make bundle
Some checks failed
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Has been cancelled
LNbits CI / test-api (, 3.10) (push) Has been cancelled
LNbits CI / test-api (, 3.11) (push) Has been cancelled
LNbits CI / test-api (, 3.12) (push) Has been cancelled
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Has been cancelled
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Has been cancelled
LNbits CI / test-wallets (, 3.10) (push) Has been cancelled
LNbits CI / test-wallets (, 3.11) (push) Has been cancelled
LNbits CI / test-wallets (, 3.12) (push) Has been cancelled
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Has been cancelled
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Has been cancelled
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Has been cancelled
LNbits CI / test-unit (, 3.10) (push) Has been cancelled
LNbits CI / test-unit (, 3.11) (push) Has been cancelled
LNbits CI / test-unit (, 3.12) (push) Has been cancelled
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Has been cancelled
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Has been cancelled
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Has been cancelled
LNbits CI / migration (3.10) (push) Has been cancelled
LNbits CI / migration (3.11) (push) Has been cancelled
LNbits CI / migration (3.12) (push) Has been cancelled
LNbits CI / openapi (push) Has been cancelled
LNbits CI / regtest (BoltzWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (CoreLightningRestWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (CoreLightningWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (EclairWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (LNbitsWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (LndRestWallet, 3.10) (push) Has been cancelled
LNbits CI / regtest (LndWallet, 3.10) (push) Has been cancelled
LNbits CI / jmeter (3.10) (push) Has been cancelled
2026-01-10 02:39:24 +01:00
Patrick Mulligan
e4eafa4528 fix(ui): correct amountless invoice detection in bolt11 decoder
Some checks failed
LNbits CI / test-api (, 3.12) (push) Blocked by required conditions
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Blocked by required conditions
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Blocked by required conditions
LNbits CI / test-api (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Blocked by required conditions
LNbits CI / test-wallets (, 3.10) (push) Blocked by required conditions
LNbits CI / test-wallets (, 3.11) (push) Blocked by required conditions
LNbits CI / test-wallets (, 3.12) (push) Blocked by required conditions
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Blocked by required conditions
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Blocked by required conditions
LNbits CI / test-wallets (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Blocked by required conditions
LNbits CI / test-unit (, 3.10) (push) Blocked by required conditions
LNbits CI / test-unit (, 3.11) (push) Blocked by required conditions
LNbits CI / test-unit (, 3.12) (push) Blocked by required conditions
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.10) (push) Blocked by required conditions
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.11) (push) Blocked by required conditions
LNbits CI / test-unit (postgres://lnbits:lnbits@0.0.0.0:5432/lnbits, 3.12) (push) Blocked by required conditions
LNbits CI / migration (3.10) (push) Blocked by required conditions
LNbits CI / migration (3.11) (push) Blocked by required conditions
LNbits CI / migration (3.12) (push) Blocked by required conditions
LNbits CI / openapi (push) Blocked by required conditions
LNbits CI / regtest (BoltzWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (CoreLightningRestWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (CoreLightningWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (EclairWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (LNbitsWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (LndRestWallet, 3.10) (push) Blocked by required conditions
LNbits CI / regtest (LndWallet, 3.10) (push) Blocked by required conditions
LNbits CI / jmeter (3.10) (push) Blocked by required conditions
codeql / analyze (push) Waiting to run
LNbits CI / nix / nix (push) Has been cancelled
The bolt11 decoder returns the string 'Any amount' for amountless
invoices, not null or 0. The previous check failed because non-empty
strings are truthy in JavaScript.

Changed detection from:
  !amount || amount === 0
To:
  typeof amount !== 'number' || amount <= 0

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-10 02:30:01 +01:00
3 changed files with 8 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -308,16 +308,17 @@ window.PageWallet = {
} }
// Check if invoice is amountless (no amount specified) // Check if invoice is amountless (no amount specified)
// The decoder returns 'Any amount' string for amountless invoices
const invoiceAmount = invoice.human_readable_part.amount
const isAmountless = const isAmountless =
!invoice.human_readable_part.amount || typeof invoiceAmount !== 'number' || invoiceAmount <= 0
invoice.human_readable_part.amount === 0
let cleanInvoice = { let cleanInvoice = {
msat: isAmountless ? null : invoice.human_readable_part.amount, msat: isAmountless ? null : invoiceAmount,
sat: isAmountless ? null : invoice.human_readable_part.amount / 1000, sat: isAmountless ? null : invoiceAmount / 1000,
fsat: isAmountless fsat: isAmountless
? this.$t('any_amount') ? this.$t('any_amount')
: LNbits.utils.formatSat(invoice.human_readable_part.amount / 1000), : LNbits.utils.formatSat(invoiceAmount / 1000),
bolt11: this.parse.data.request, bolt11: this.parse.data.request,
isAmountless: isAmountless isAmountless: isAmountless
} }