Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
remove impossible case where pending header not exists
Browse files Browse the repository at this point in the history
  • Loading branch information
didaunesp committed Feb 26, 2024
1 parent ee9904c commit bba3476
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions core/slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,15 +335,8 @@ func (sl *Slice) Append(header *types.Header, domPendingHeader *types.Header, do

var time8, time9 common.PrettyDuration
var bestPh types.PendingHeader
var exist bool
if nodeCtx == common.ZONE_CTX {
bestPh, exist = sl.readPhCache(sl.bestPhKey)
if !exist {
sl.WriteBestPhKey(sl.config.GenesisHash)
sl.writePhCache(block.Hash(), pendingHeaderWithTermini)
bestPh = types.EmptyPendingHeader()
sl.logger.WithField("key", sl.bestPhKey).Warn("BestPh Key does not exist")
}
bestPh, _ = sl.readPhCache(sl.bestPhKey)

time8 = common.PrettyDuration(time.Since(start))

Expand Down

0 comments on commit bba3476

Please sign in to comment.