Skip to content

Commit

Permalink
added return and unlock to payment status conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Oct 22, 2024
1 parent 9cffbae commit f03c576
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions handlers/bounty.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,9 @@ func (h *bountyHandler) MakeBountyPayment(w http.ResponseWriter, r *http.Request
if err == nil {
socket.Conn.WriteJSON(msg)
}

h.m.Unlock()
return
} else if v2KeysendRes.Status == db.PaymentPending {
// Send payment status
log.Printf("[bounty] V2 Status is pending: %s", v2KeysendRes.Status)
Expand All @@ -710,6 +713,9 @@ func (h *bountyHandler) MakeBountyPayment(w http.ResponseWriter, r *http.Request
if err == nil {
socket.Conn.WriteJSON(msg)
}

h.m.Unlock()
return
} else {
// Send payment status
log.Printf("[bounty] V2 Status Was not completed: %s", v2KeysendRes.Status)
Expand Down Expand Up @@ -833,8 +839,6 @@ func (h *bountyHandler) MakeBountyPayment(w http.ResponseWriter, r *http.Request
return
}
}

h.m.Unlock()
}

func (h *bountyHandler) GetBountyPaymentStatus(w http.ResponseWriter, r *http.Request) {
Expand Down

0 comments on commit f03c576

Please sign in to comment.