Fix tx value used on BeginTx error

This commit is contained in:
ekzyis 2023-11-29 18:38:04 +01:00
parent 6ca06e5372
commit 5edb220b37
1 changed files with 0 additions and 2 deletions

View File

@ -80,7 +80,6 @@ func HandleCreateMarket(sc context.ServerContext) echo.HandlerFunc {
ctx, cancel := context_.WithTimeout(c.Request().Context(), 5*time.Second)
defer cancel()
if tx, err = sc.Db.BeginTx(ctx, nil); err != nil {
tx.Rollback()
return err
}
defer tx.Commit()
@ -172,7 +171,6 @@ func HandleOrder(sc context.ServerContext) echo.HandlerFunc {
ctx, cancel := context_.WithTimeout(c.Request().Context(), 5*time.Second)
defer cancel()
if tx, err = sc.Db.BeginTx(ctx, nil); err != nil {
tx.Rollback()
return err
}
defer tx.Commit()