func (db *DB) RunMatchingBestPrices(pair *match.Pair) (err error) {

	tx, err := db.DBHandler.Begin()
	if err != nil {
		return fmt.Errorf("Error beginning transaction while updating deposits: \n%s", err)
	}
	defer func() {
		if err != nil {
			tx.Rollback()
			err = fmt.Errorf("Error while running matching, this might be bad: \n%s", err)
			return
		}
		err = tx.Commit()
	}()

	if _, err = tx.Exec("USE " + db.orderSchema + ";"); err != nil {
		return
	}

	if err = db.RunMatchingBestPricesWithinTransaction(pair, tx); err != nil {
		return
	}

	return
}
// RunMatchingBestPrices runs matching only on the best prices. Creates a transaction.
RunMatchingBestPrices runs matching only on the best prices. Creates a transaction.
// RunMatchingBestPrices runs matching only on the best prices . Creates a transaction .
func (db *DB) RunMatchingBestPrices(pair *match.Pair) (err error) {
	tx, err := db.DBHandler.Begin()
	if err != nil {
		return fmt.Errorf("Error beginning transaction while updating deposits: \n%s", err)
	}
	defer func() {
		if err != nil {
			tx.Rollback()
			err = fmt.Errorf("Error while running matching, this might be bad: \n%s", err)
			return
		}
		err = tx.Commit()
	}()
	if _, err = tx.Exec("USE " + db.orderSchema + ";"); err != nil {
		return
	}
	if err = db.RunMatchingBestPricesWithinTransaction(pair, tx); err != nil {
		return
	}
	return
}
func ( db * DB ) RunMatchingBestPrices ( pair * match . Pair ) ( err error ) { tx , err := db . DBHandler . Begin ( ) if err != nil { return fmt . Errorf ( " \n " , err ) } defer func ( ) { if err != nil { tx . Rollback ( ) err = fmt . Errorf ( " \n " , err ) return } err = tx . Commit ( ) } ( ) if _ , err = tx . Exec ( " " + db . orderSchema + " " ) ; err != nil { return } if err = db . RunMatchingBestPricesWithinTransaction ( pair , tx ) ; err != nil { return } return }
RunMatchingBestPrices runs matching only on the best prices.
RunMatchingBestPrices runs matching only on the best prices .