core/state: rework dirty handling to avoid quadratic overhead

This commit is contained in:
Martin Holst Swende
2017-10-01 21:07:30 +02:00
committed by Péter Szilágyi
parent 1a8894b3d5
commit 958ed4f3d9
6 changed files with 112 additions and 79 deletions

View File

@ -413,11 +413,12 @@ func (s *StateSuite) TestTouchDelete(c *check.C) {
snapshot := s.state.Snapshot()
s.state.AddBalance(common.Address{}, new(big.Int))
if len(s.state.stateObjectsDirty) != 1 {
if len(s.state.journal.flatten()) != 1 {
c.Fatal("expected one dirty state object")
}
s.state.RevertToSnapshot(snapshot)
if len(s.state.stateObjectsDirty) != 0 {
if len(s.state.journal.flatten()) != 0 {
c.Fatal("expected no dirty state object")
}
}