This commit is contained in:
maskpp 2024-06-01 14:18:59 +08:00
parent d4b81f0e08
commit 6a6e778102
2 changed files with 2 additions and 2 deletions

View file

@ -232,7 +232,7 @@ func (db *Database) repairHistory() error {
// to only keep 128 diff layers in memory by default. // to only keep 128 diff layers in memory by default.
// //
// The passed in maps(nodes, states) will be retained to avoid copying everything. // The passed in maps(nodes, states) will be retained to avoid copying everything.
// Therefore, these maps must not be changed afterwards. // Therefore, these maps must not be changed afterward.
func (db *Database) Update(root common.Hash, parentRoot common.Hash, block uint64, nodes *trienode.MergedNodeSet, states *triestate.Set) error { func (db *Database) Update(root common.Hash, parentRoot common.Hash, block uint64, nodes *trienode.MergedNodeSet, states *triestate.Set) error {
// Hold the lock to prevent concurrent mutations. // Hold the lock to prevent concurrent mutations.
db.lock.Lock() db.lock.Lock()

View file

@ -183,7 +183,7 @@ func (dl *diskLayer) commit(bottom *diffLayer, force bool) (*diskLayer, error) {
// Mark the diskLayer as stale before applying any mutations on top. // Mark the diskLayer as stale before applying any mutations on top.
dl.stale = true dl.stale = true
// Store the root->id lookup afterwards. All stored lookups are identified // Store the root->id lookup afterward. All stored lookups are identified
// by the **unique** state root. It's impossible that in the same chain // by the **unique** state root. It's impossible that in the same chain
// blocks are not adjacent but have the same root. // blocks are not adjacent but have the same root.
if dl.id == 0 { if dl.id == 0 {