Skip to content

Commit

Permalink
only add to taskResponseMap if doesn't already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
afkbyte committed May 25, 2024
1 parent 86a5aa1 commit 63b6a39
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions services/bls_aggregation/blsagg.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,6 @@ func (a *BlsAggregatorService) ProcessNewSignature(
ctx context.Context,
taskIndex types.TaskIndex,
taskResponse types.TaskResponse,
//taskResponseDigest types.TaskResponseDigest,
blsSignature *bls.Signature,
operatorId types.OperatorId,
) error {
Expand All @@ -199,8 +198,12 @@ func (a *BlsAggregatorService) ProcessNewSignature(
// compute the taskResponseDigest, note that this is now enforcing a specific encoding for the taskResponse
taskResponseDigest := types.TaskResponseDigest(sha256.Sum256(taskResponse))

// Store the TaskResponse in our mapping
a.taskResponseMap[taskResponseDigest] = taskResponse
// check if the taskResponseDigest is already in the map
_, taskResponseExists := a.taskResponseMap[taskResponseDigest]
if !taskResponseExists {
// Store the TaskResponse in our mapping
a.taskResponseMap[taskResponseDigest] = taskResponse
}

signatureVerificationErrorC := make(chan error)
// send the task to the goroutine processing this task
Expand Down

0 comments on commit 63b6a39

Please sign in to comment.