Skip to content

Commit b954716

Browse files
authored
[fix] redis.GetBidTrace should return err=redis.Nil on missing item (#468)
redis.GetBidTrace fix on missing item
1 parent b0ee7d4 commit b954716

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

datastore/redis.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,13 +393,11 @@ func (r *RedisCache) SaveBidTrace(ctx context.Context, tx redis.Pipeliner, trace
393393
return r.SetObjPipelined(ctx, tx, key, trace, expiryBidCache)
394394
}
395395

396+
// GetBidTrace returns (trace, nil), or (nil, redis.Nil) if the trace does not exist
396397
func (r *RedisCache) GetBidTrace(slot uint64, proposerPubkey, blockHash string) (*common.BidTraceV2, error) {
397398
key := r.keyCacheBidTrace(slot, proposerPubkey, blockHash)
398399
resp := new(common.BidTraceV2)
399400
err := r.GetObj(key, resp)
400-
if errors.Is(err, redis.Nil) {
401-
return nil, nil
402-
}
403401
return resp, err
404402
}
405403

0 commit comments

Comments
 (0)