// GetTotalOfRewardBalances returns the sum of all balances
GetTotalOfRewardBalances returns the sum of all balances
// GetTotalOfRewardBalances returns the sum of all balances
func GetTotalOfRewardBalances(node sqalx.Node) (decimal.Decimal, error) {
	tx, err := node.Beginx()
	if err != nil {
		return decimal.Zero, stacktrace.Propagate(err, "")
	}
	defer tx.Commit() 
	var tPtr *decimal.Decimal 
	err = sdb.Select("SUM(balance)").From("reward_balance").RunWith(tx).Scan(&tPtr)
	if tPtr == nil {
		return decimal.Zero, nil
	}
	return *tPtr, stacktrace.Propagate(err, "")
}
func GetTotalOfRewardBalances ( node sqalx . Node ) ( decimal . Decimal , error ) { tx , err := node . Beginx ( ) if err != nil { return decimal . Zero , stacktrace . Propagate ( err , " " ) } defer tx . Commit ( ) var tPtr * decimal . Decimal err = sdb . Select ( " " ) . From ( " " ) . RunWith ( tx ) . Scan ( & tPtr ) if tPtr == nil { return decimal . Zero , nil } return * tPtr , stacktrace . Propagate ( err , " " ) }
GetTotalOfRewardBalances returns the sum of all balances
GetTotalOfRewardBalances returns the sum of all balances
// read-only tx // the sum may be NULL if there are no rows