Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
saolyn committed Nov 6, 2024
1 parent c526fce commit 8723bcc
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion beacon-chain/rpc/eth/beacon/handlers_pool.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,16 @@ func (s *Server) SubmitAttestations(w http.ResponseWriter, r *http.Request) {

var sourceAttestations []*structs.Attestation
if err := json.Unmarshal(req.Data, &sourceAttestations); err != nil {
httputil.HandleError(w, fmt.Sprintf("Failed to unmarshal request: %v", err), http.StatusInternalServerError)
var singleAttestation *structs.Attestation
if err := json.Unmarshal(req.Data, &singleAttestation); err != nil {
httputil.HandleError(w, "Could not parse data into attestations: "+err.Error(), http.StatusBadRequest)
return
}
sourceAttestations = append(sourceAttestations, singleAttestation)
}

if len(sourceAttestations) == 0 {
httputil.HandleError(w, "No data submitted", http.StatusBadRequest)
return
}

Expand Down

0 comments on commit 8723bcc

Please sign in to comment.