Skip to content

Commit

Permalink
fix builder collateral endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
avalonche committed May 14, 2024
1 parent 2684dac commit 67acc58
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions services/api/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2958,14 +2958,14 @@ func (api *RelayAPI) handleInternalBuilderCollateral(w http.ResponseWriter, req
if req.Method == http.MethodPost || req.Method == http.MethodPut {
args := req.URL.Query()
collateral := args.Get("collateral")
value := args.Get("value")
builderID := args.Get("builder_id")
log := api.log.WithFields(logrus.Fields{
"pubkey": builderPubkey,
"collateral": collateral,
"value": value,
"builderID": builderID,
})
log.Infof("updating builder collateral")
if err := api.db.SetBlockBuilderCollateral(builderPubkey, collateral, value); err != nil {
if err := api.db.SetBlockBuilderCollateral(builderPubkey, builderID, collateral); err != nil {
fullErr := fmt.Errorf("unable to set collateral in db for pubkey: %v: %w", builderPubkey, err)
log.Error(fullErr.Error())
api.RespondError(w, http.StatusInternalServerError, fullErr.Error())
Expand Down

0 comments on commit 67acc58

Please sign in to comment.