diff --git a/handlers/bounty.go b/handlers/bounty.go index 350e5fe07..e7a24b68f 100644 --- a/handlers/bounty.go +++ b/handlers/bounty.go @@ -543,6 +543,9 @@ func (h *bountyHandler) MakeBountyPayment(w http.ResponseWriter, r *http.Request } func (h *bountyHandler) BountyBudgetWithdraw(w http.ResponseWriter, r *http.Request) { + var m sync.Mutex + m.Lock() + ctx := r.Context() pubKeyFromAuth, _ := ctx.Value(auth.ContextKey).(string) @@ -599,6 +602,8 @@ func (h *bountyHandler) BountyBudgetWithdraw(w http.ResponseWriter, r *http.Requ errMsg := formatPayError("Could not pay lightning invoice") json.NewEncoder(w).Encode(errMsg) } + + m.Unlock() } func formatPayError(errorMsg string) db.InvoicePayError {