fix: show proper total balances fix cleanups (#2490)

payments are not deleted oif we delete a wallets, so to get a accurate
total representation of the lnbits balance we need to create the
balances view based on the wallets table, not payments, else deleted
balances will still show up.

2nd, delete_unused_wallets and delete_accounts was never working if
because they never got an updated_at time, so i just check if its null
else i check to timedelta on created_at
This commit is contained in:
dni ⚡
2024-05-13 18:01:53 +01:00
committed by GitHub
parent a5623ef7c3
commit 32596758cc
3 changed files with 40 additions and 5 deletions
+1 -1
View File
@@ -206,7 +206,7 @@ async def database_delete_wallet(wallet: str):
@click.option("-c", "--checking-id", required=True, help="Payment checking Id.")
@coro
async def database_delete_wallet_payment(wallet: str, checking_id: str):
"""Mark wallet as deleted"""
"""Delete wallet payment"""
async with core_db.connect() as conn:
await delete_wallet_payment(
wallet_id=wallet, checking_id=checking_id, conn=conn