Skip to content
Snippets Groups Projects
Commit 6b5db999 authored by Lukas Braun's avatar Lukas Braun
Browse files

remove unused named return parameters in check_offer

parent d371828c
No related branches found
No related tags found
No related merge requests found
......@@ -173,12 +173,14 @@ func transaction_failed(err error) bool {
// Retrieve secret and count for given username and try to find a match within
// the lookahead range. Update count in DB if match is found. All within a
// transaction, retrying if it fails.
func check_offer(db *sql.DB, remote net.Addr, name string, offer string) (ok bool, err error) {
func check_offer(db *sql.DB, remote string, name string, offer string) (bool, error) {
for {
debugf("[%v] begin transaction", remote)
tx, err := db.Begin()
err_panic(err)
ok := false
debugf("[%v] looking up data for %v", remote, name)
hotp, err := get_otp(tx, name)
if transaction_failed(err) {
......@@ -207,8 +209,6 @@ func check_offer(db *sql.DB, remote net.Addr, name string, offer string) (ok boo
}
}
ok = false
commit:
debugf("[%v] commiting", remote)
err = tx.Commit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment