mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-21 20:26:41 +00:00
triedb: set generate progress to 100 after root verification
Only report completion once the assembled trie root matches the expected root, not immediately after worker goroutines finish.
This commit is contained in:
parent
ab134b2101
commit
172dd2e1fc
1 changed files with 3 additions and 3 deletions
|
|
@ -423,9 +423,6 @@ func GenerateTrieWithProgress(db ethdb.Database, scheme string, root common.Hash
|
|||
if err := eg.Wait(); err != nil {
|
||||
return GenerateStats{}, err
|
||||
}
|
||||
if prog != nil {
|
||||
prog.Store(100)
|
||||
}
|
||||
// Assemble the top-level root from the partition blobs and verify it
|
||||
// matches the expected root.
|
||||
got, err := assembleRoot(db, scheme, partitionBlobs)
|
||||
|
|
@ -435,6 +432,9 @@ func GenerateTrieWithProgress(db ethdb.Database, scheme string, root common.Hash
|
|||
if got != root {
|
||||
return GenerateStats{}, fmt.Errorf("state root mismatch: got %x, want %x", got, root)
|
||||
}
|
||||
if prog != nil {
|
||||
prog.Store(100)
|
||||
}
|
||||
log.Info("Generated state trie",
|
||||
"accounts", c.accounts.Load(), "slots", c.slots.Load(),
|
||||
"account-nodes", c.accountTrieNodes.Load(), "storage-nodes", c.storageTrieNodes.Load(),
|
||||
|
|
|
|||
Loading…
Reference in a new issue