dkforest

A forum and chat platform (onion)
git clone https://git.dasho.dev/n0tr1v/dkforest.git
Log | Files | Refs | LICENSE

commit f8d52eccee29634d52762ae15610038387079873
parent 4a0c3db6251f39b8ec3f5feaf91d1dcd6a0e5e9f
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri, 15 Dec 2023 02:49:21 -0500

move

Diffstat:
Mpkg/web/handlers/handlers.go | 14+++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -844,6 +844,13 @@ func PokerHomeHandler(c echo.Context) error { } withdrawAmount = utils.Clamp(withdrawAmount, minWithdrawAmount, userBalance) + lastOutTransaction, _ := db.GetLastUserWithdrawPokerXmrTransaction(authUser.ID) + if time.Since(lastOutTransaction.CreatedAt) < 5*time.Minute { + diff := time.Until(lastOutTransaction.CreatedAt.Add(5 * time.Minute)) + data.Error = fmt.Sprintf("Wait %s before doing a new withdraw transaction", utils.ShortDur(diff)) + return c.Render(http.StatusOK, "poker", data) + } + res, err := config.Xmr().Transfer(&wallet1.RequestTransfer{ DoNotRelay: true, GetTxMetadata: true, @@ -863,13 +870,6 @@ func PokerHomeHandler(c echo.Context) error { return c.Render(http.StatusOK, "poker", data) } - lastOutTransaction, _ := db.GetLastUserWithdrawPokerXmrTransaction(authUser.ID) - if time.Since(lastOutTransaction.CreatedAt) < 5*time.Minute { - diff := time.Until(lastOutTransaction.CreatedAt.Add(5 * time.Minute)) - data.Error = fmt.Sprintf("Wait %s before doing a new withdraw transaction", utils.ShortDur(diff)) - return c.Render(http.StatusOK, "poker", data) - } - dutils.RootAdminNotify(db, fmt.Sprintf("new withdraw %s xmr by %s", withdrawAmount.XmrStr(), authUser.Username)) tx := db.Begin()