Skip to content

Commit ee62215

Browse files
authored
Fix false positive in boolean flag (#500)
fix(redis): move WasBidSaved to after exec We have several conditions where we don't execute the pipelined commands. Only set the WasBidSaved flag after we execute the pipeline successfully. Do note, if the pipeline fails we may or may not have actually saved the bid.
1 parent e0d1248 commit ee62215

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

datastore/redis.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,6 @@ func (r *RedisCache) SaveBidAndUpdateTopBid(ctx context.Context, pipeliner redis
513513
if err != nil {
514514
return state, err
515515
}
516-
state.WasBidSaved = true
517516
builderBids.bidValues[payload.BuilderPubkey().String()] = payload.Value()
518517

519518
// Record time needed to save bid
@@ -543,6 +542,8 @@ func (r *RedisCache) SaveBidAndUpdateTopBid(ctx context.Context, pipeliner redis
543542
return state, err
544543
}
545544
state.IsNewTopBid = payload.Value().Cmp(state.TopBidValue) == 0
545+
// An Exec happens in _updateTopBid.
546+
state.WasBidSaved = true
546547

547548
// Record time needed to update top bid
548549
nextTime = time.Now().UTC()

0 commit comments

Comments
 (0)