Skip to content

Commit

Permalink
fix: fix incorrect comment
Browse files Browse the repository at this point in the history
  • Loading branch information
VM committed Mar 27, 2024
1 parent e3a02fb commit 23621c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/blockchain.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ func (bc *BlockChain) tryRewindBadBlocks() {
}
}

// rewindPathHead implements the logic of rewindHead in the context of hash scheme.
// rewindHashHead implements the logic of rewindHead in the context of hash scheme.
func (bc *BlockChain) rewindHashHead(head *types.Header, root common.Hash) (*types.Header, uint64) {
var (
limit uint64 // The oldest block that will be searched for this rewinding
Expand Down
4 changes: 3 additions & 1 deletion triedb/pathdb/disklayer.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,9 @@ func (dl *diskLayer) commit(bottom *diffLayer, force bool) (*diskLayer, error) {
// truncation) surpasses the persisted state ID, we take the necessary action
// of forcibly committing the cached dirty nodes to ensure that the persisted
// state ID remains higher.
if !force && rawdb.ReadPersistentStateID(dl.db.diskdb) < oldest {
stateID := rawdb.ReadPersistentStateID(dl.db.diskdb)
log.Info("disk layer", "stateID", stateID, "oldest", oldest, "ndl.id", ndl.id)
if !force && stateID < oldest {
force = true
}
if err := ndl.buffer.flush(ndl.db.diskdb, ndl.cleans, ndl.id, force); err != nil {
Expand Down

0 comments on commit 23621c5

Please sign in to comment.