dkforest

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

commit 7cfcb196df76260b1ccac1abc1d8d395e4b1cb6d
parent 34bf60c1ebb731aae405dcfbea53be92efc3ccfe
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Thu, 14 Dec 2023 02:23:40 -0500

remove house fee on withdraw

Diffstat:
Mpkg/web/handlers/handlers.go | 15+++------------
Mpkg/web/public/views/pages/poker.gohtml | 2+-
2 files changed, 4 insertions(+), 13 deletions(-)

diff --git a/pkg/web/handlers/handlers.go b/pkg/web/handlers/handlers.go @@ -753,10 +753,6 @@ func BHCHandler(c echo.Context) error { return c.Render(http.StatusOK, "bhc", data) } -const pokerHouseFee = 0.07 -const pokerHouseXmrAddressLive = "83pJEonAgps6F61RSk6SAmFi4xmq4zVYmaDTk8eFGLE49dm1ZE2bLVaWqumHLRGU8gewV6wGffmhrV3RN35TXy8CK9UhWMa" -const pokerHouseXmrAddressStag = "5B3jkfaD5Bu7NqyzuDqBjTgdCPKSfiqgmAznEhwxunLLQ1u9NzmeRvbHtNhyBf5xQV7fL6S7TEXNrgNSv3e4wdtA32cRyKc" - func PokerHomeHandler(c echo.Context) error { db := c.Get("database").(*database.DkfDB) authUser := c.Get("authUser").(*database.User) @@ -806,17 +802,12 @@ func PokerHomeHandler(c echo.Context) error { } withdrawAmount = utils.Clamp(withdrawAmount, minWithdrawAmount, userChips) - houseFee := database.Piconero(pokerHouseFee * float64(withdrawAmount)) - withdrawAmount -= houseFee - res, err := config.Xmr().Transfer(&wallet1.RequestTransfer{ DoNotRelay: true, GetTxMetadata: true, Destinations: []*wallet1.Destination{ {Address: data.WithdrawAddress, - Amount: uint64(withdrawAmount)}, - {Address: pokerHouseXmrAddressStag, - Amount: uint64(houseFee)}}}) + Amount: uint64(withdrawAmount)}}}) if err != nil { logrus.Error(err) data.Error = err.Error() @@ -825,13 +816,13 @@ func PokerHomeHandler(c echo.Context) error { transactionFee := database.Piconero(res.Fee) - if withdrawAmount+houseFee+transactionFee > authUser.XmrBalanceStagenet { + if withdrawAmount+transactionFee > authUser.XmrBalanceStagenet { data.Error = fmt.Sprintf("not enough funds to pay for transaction fee %d (%s xmr)", transactionFee, transactionFee.XmrStr()) return c.Render(http.StatusOK, "poker", data) } tx := db.Begin() - if err := authUser.SubXmrBalanceStagenet(db, withdrawAmount+houseFee+transactionFee); err != nil { + if err := authUser.SubXmrBalanceStagenet(db, withdrawAmount+transactionFee); err != nil { data.Error = err.Error() tx.Rollback() return c.Render(http.StatusOK, "poker", data) diff --git a/pkg/web/public/views/pages/poker.gohtml b/pkg/web/public/views/pages/poker.gohtml @@ -14,7 +14,7 @@ {{ end }} </div> 0.01xmr == 1000chips<br /> - 7% house fee on withdraw.<br /> + rake is max %7 (rounded down) 10 confirmations needed for deposits (~20min)<br /> <div class="clearfix"></div> </div>