core/state: avoid linear overhead on journal dirty listing

This commit is contained in:
Péter Szilágyi
2018-03-27 15:13:30 +03:00
parent 958ed4f3d9
commit d985b9052a
4 changed files with 93 additions and 67 deletions

View File

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