Skip to content

Commit

Permalink
Merge pull request #27 from uprendis/feature/add-snap-generating-check
Browse files Browse the repository at this point in the history
Add snap.Generating method
  • Loading branch information
quan8 committed Dec 23, 2021
2 parents bb6c998 + 889c41a commit 3db2e88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/state/snapshot/journal.go
Expand Up @@ -25,6 +25,7 @@ import (
"time"

"github.com/VictoriaMetrics/fastcache"

"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/rawdb"
"github.com/ethereum/go-ethereum/ethdb"
Expand Down Expand Up @@ -113,7 +114,7 @@ func loadAndParseJournal(db ethdb.KeyValueStore, base *diskLayer) (snapshot, jou
// It can happen that Geth crashes without persisting the latest
// diff journal.
if !bytes.Equal(root.Bytes(), base.root.Bytes()) {
log.Warn("Loaded snapshot journal", "diskroot", base.root, "diffs", "unmatched")
log.Debug("Loaded snapshot journal", "diskroot", base.root, "diffs", "unmatched")
return base, generator, nil
}
// Load all the snapshot diffs from the journal
Expand Down
4 changes: 4 additions & 0 deletions core/state/snapshot/snapshot.go
Expand Up @@ -826,6 +826,10 @@ func (t *Tree) generating() (bool, error) {
return layer.genMarker != nil, nil
}

func (t *Tree) Generating() (bool, error) {
return t.generating()
}

// diskRoot is a external helper function to return the disk layer root.
func (t *Tree) DiskRoot() common.Hash {
t.lock.Lock()
Expand Down

0 comments on commit 3db2e88

Please sign in to comment.