Skip to content

Commit

Permalink
Merge pull request stakwork#2505 from aliraza556/feature/fix-bounty-t…
Browse files Browse the repository at this point in the history
…iming-on-proof-update

feat(bounty): Improve Proof of Work Timer Handling on Status Update
  • Loading branch information
humansinstitute authored Jan 29, 2025
2 parents b124027 + 3e29747 commit bedb818
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions handlers/bounty.go
Original file line number Diff line number Diff line change
Expand Up @@ -1805,9 +1805,14 @@ func (h *bountyHandler) UpdateProofStatus(w http.ResponseWriter, r *http.Request
return
}

if err := h.db.UpdateBountyTimingOnProof(id); err != nil {
http.Error(w, "Failed to update timing", http.StatusInternalServerError)
return
_, err = h.db.GetBountyTiming(id)
if err == nil {
if err := h.db.UpdateBountyTimingOnProof(id); err != nil {
http.Error(w, "Failed to update timing", http.StatusInternalServerError)
return
}
} else {
logger.Log.Error(fmt.Sprintf("No bounty timing found for bounty ID %d: %v", id, err))
}
}

Expand Down

0 comments on commit bedb818

Please sign in to comment.