Skip to content

Commit

Permalink
fix: pbss snapshot inconsistent status fix
Browse files Browse the repository at this point in the history
  • Loading branch information
krish-nr committed Sep 27, 2024
1 parent 651bba6 commit 51a4d71
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,14 +400,13 @@ func NewBlockChain(db ethdb.Database, cacheConfig *CacheConfig, genesis *Genesis

//fix pbss snapshot if needed
if bc.triedb.Scheme() == rawdb.PathScheme {
log.Info("pbss snapshot validation")
log.Debug("pbss snapshot validation")
currentSafe := bc.CurrentSafeBlock()
currentFinalize := bc.CurrentFinalBlock()

if currentSafe.Number.Uint64() > head.Number.Uint64() || currentFinalize.Number.Uint64() > head.Number.Uint64() {
log.Info("current unsafe is behind safe, reset")
bc.hc.SetHead(head.Number.Uint64(), nil, createDelFn(bc))
//想办法
bc.SetSafe(head)
bc.SetFinalized(head)
}
Expand Down

0 comments on commit 51a4d71

Please sign in to comment.