dkforest

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

commit 74f80b182f4e6929a776bc09501b96081590d503
parent b6468077ba169df7b675a749189d663117e693a3
Author: n0tr1v <n0tr1v@protonmail.com>
Date:   Sun, 17 Dec 2023 16:34:26 -0500

admin

Diffstat:
Mpkg/database/tablePokerXmrTransactions.go | 10++++------
1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/pkg/database/tablePokerXmrTransactions.go b/pkg/database/tablePokerXmrTransactions.go @@ -23,16 +23,14 @@ type PokerXmrTransaction struct { } func (d *DkfDB) GetPokerXmrTransactionsSumIn() (out Piconero, err error) { - return d.getPokerXmrTransactionsSum(true) + var tmp struct{ Amount Piconero } + err = d.db.Raw(`SELECT SUM(amount) AS amount FROM poker_xmr_transactions WHERE is_in = 1 AND confirmations >= 10`).Scan(&tmp).Error + return tmp.Amount, err } func (d *DkfDB) GetPokerXmrTransactionsSumOut() (out Piconero, err error) { - return d.getPokerXmrTransactionsSum(false) -} - -func (d *DkfDB) getPokerXmrTransactionsSum(isIn bool) (out Piconero, err error) { var tmp struct{ Amount Piconero } - err = d.db.Raw(`SELECT SUM(amount) AS amount FROM poker_xmr_transactions WHERE is_in = ?`, isIn).Scan(&tmp).Error + err = d.db.Raw(`SELECT SUM(amount) AS amount FROM poker_xmr_transactions WHERE is_in = 0`).Scan(&tmp).Error return tmp.Amount, err }