dkforest

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

commit d54e23b49c5df2c3d2a4e8dc9fd39e38f3a3faac
parent 8091ba65663651d27098c49c27436d26ad880cff
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Fri, 15 Dec 2023 01:08:26 -0500

refactor

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

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -832,12 +832,12 @@ func PokerHomeHandler(c echo.Context) error { data.Error = fmt.Sprintf("minimum withdraw amount is %d", minWithdrawAmount) return c.Render(http.StatusOK, "poker", data) } - userChips := authUser.XmrBalance - if withdrawAmount > userChips { - data.Error = fmt.Sprintf("maximum withdraw amount is %d (%d)", userChips, withdrawAmount) + userBalance := authUser.XmrBalance + if withdrawAmount > userBalance { + data.Error = fmt.Sprintf("maximum withdraw amount is %d (%d)", userBalance, withdrawAmount) return c.Render(http.StatusOK, "poker", data) } - withdrawAmount = utils.Clamp(withdrawAmount, minWithdrawAmount, userChips) + withdrawAmount = utils.Clamp(withdrawAmount, minWithdrawAmount, userBalance) res, err := config.Xmr().Transfer(&wallet1.RequestTransfer{ DoNotRelay: true,