This commit is contained in:
ekzyis 2023-12-03 02:01:27 +01:00
parent ac3008ec74
commit 0be35c5cf5
1 changed files with 1 additions and 0 deletions

View File

@ -286,6 +286,7 @@ func HandleDeleteOrder(sc context.ServerContext) echo.HandlerFunc {
if o.Invoice.ConfirmedAt.Valid { if o.Invoice.ConfirmedAt.Valid {
// order already paid: we need to move paid sats to user balance before deleting the order // order already paid: we need to move paid sats to user balance before deleting the order
// TODO update order and session on client
msats = o.Invoice.MsatsReceived msats = o.Invoice.MsatsReceived
if res, err := tx.ExecContext(ctx, "UPDATE users SET msats = msats + $1 WHERE pubkey = $2", msats, u.Pubkey); err != nil { if res, err := tx.ExecContext(ctx, "UPDATE users SET msats = msats + $1 WHERE pubkey = $2", msats, u.Pubkey); err != nil {
tx.Rollback() tx.Rollback()