mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 12:10:05 +00:00
set bool correctly (#3913)
This commit is contained in:
parent
da6c270d46
commit
ab92326dfb
@ -259,9 +259,10 @@ func ProcessSlots(ctx context.Context, state *pb.BeaconState, slot uint64) (*pb.
|
|||||||
cached, ok := skipSlotCache.Get(root)
|
cached, ok := skipSlotCache.Get(root)
|
||||||
// if cache key does not exist, we write it to the cache.
|
// if cache key does not exist, we write it to the cache.
|
||||||
writeToCache = !ok
|
writeToCache = !ok
|
||||||
if ok && cached.(*pb.BeaconState).Slot <= slot {
|
if ok {
|
||||||
// do not write to cache if state with higher slot exists.
|
// do not write to cache if state with higher slot exists.
|
||||||
writeToCache = writeToCache || cached.(*pb.BeaconState).Slot <= slot
|
writeToCache = cached.(*pb.BeaconState).Slot <= slot
|
||||||
|
if cached.(*pb.BeaconState).Slot <= slot {
|
||||||
state = proto.Clone(cached.(*pb.BeaconState)).(*pb.BeaconState)
|
state = proto.Clone(cached.(*pb.BeaconState)).(*pb.BeaconState)
|
||||||
highestSlot = state.Slot
|
highestSlot = state.Slot
|
||||||
skipSlotCacheHit.Inc()
|
skipSlotCacheHit.Inc()
|
||||||
@ -269,6 +270,7 @@ func ProcessSlots(ctx context.Context, state *pb.BeaconState, slot uint64) (*pb.
|
|||||||
skipSlotCacheMiss.Inc()
|
skipSlotCacheMiss.Inc()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for state.Slot < slot {
|
for state.Slot < slot {
|
||||||
if ctx.Err() != nil {
|
if ctx.Err() != nil {
|
||||||
|
@ -3,8 +3,8 @@ package version
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
"log"
|
||||||
"strings"
|
|
||||||
"os/exec"
|
"os/exec"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user