commit a71b1f1e38df7f74137a0543440dbc0d224b79c2
parent 8bba6d9c494d4cae053b42b1a5613ed33dde4a73
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Mon, 18 Dec 2023 13:09:20 -0500
fix admin
Diffstat:
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/pkg/actions/actions.go b/pkg/actions/actions.go
@@ -268,15 +268,16 @@ func processPokerTransfer(db *database.DkfDB, transfer *wallet1.Transfer) (found
return true
}
} else {
+ if pokerTransfer.Confirmations < 10 {
+ pokerTransfer.Confirmations = utils.MinInt(transfer.Confirmations, 10)
+ pokerTransfer.DoSave(db)
+ }
if pokerTransfer.Processed {
return true
}
user, _ = db.GetUserByID(pokerTransfer.UserID)
}
- pokerTransfer.Confirmations = utils.MinInt(transfer.Confirmations, pokerTransfer.ConfirmationsNeeded())
- pokerTransfer.DoSave(db)
-
if !pokerTransfer.HasEnoughConfirmations() {
return true
}
diff --git a/pkg/database/tablePokerTables.go b/pkg/database/tablePokerTables.go
@@ -96,7 +96,7 @@ func (d *DkfDB) GetPokerTableAccounts(userID UserID) (out []PokerTableAccount, e
func (d *DkfDB) GetPokerTableAccountSums() (sumAmounts, sumBets PokerChip, err error) {
var tmp struct{ SumAmounts, SumBets PokerChip }
- err = d.db.Raw(`SELECT SUM(amount) AS sum_amounts, SUM(amount_bet) AS sum_bets FROM poker_table_accounts`).Scan(&tmp).Error
+ err = d.db.Raw(`SELECT SUM(amount) AS sum_amounts, SUM(amount_bet) AS sum_bets FROM poker_table_accounts INNER JOIN poker_tables t ON t.id= poker_table_id WHERE t.is_test = 0`).Scan(&tmp).Error
return tmp.SumAmounts, tmp.SumBets, err
}