Patch for concurrent iterator & others (onto v1.11.6) #386
@ -662,8 +662,9 @@ func (db *Database) Commit(node common.Hash, report bool, callback func(common.H
|
||||
// Uncache any leftovers in the last batch
|
||||
db.lock.Lock()
|
||||
defer db.lock.Unlock()
|
||||
|
||||
batch.Replay(uncacher)
|
||||
if err := batch.Replay(uncacher); err != nil {
|
||||
return err
|
||||
}
|
||||
batch.Reset()
|
||||
|
||||
// Reset the storage counters and bumped metrics
|
||||
@ -711,9 +712,12 @@ func (db *Database) commit(hash common.Hash, batch ethdb.Batch, uncacher *cleane
|
||||
return err
|
||||
}
|
||||
db.lock.Lock()
|
||||
batch.Replay(uncacher)
|
||||
err := batch.Replay(uncacher)
|
||||
batch.Reset()
|
||||
db.lock.Unlock()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user