aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/state_object.go
diff options
context:
space:
mode:
authorgary rong <garyrong0905@gmail.com>2017-04-05 06:44:16 +0800
committerFelix Lange <fjl@users.noreply.github.com>2017-04-05 06:44:16 +0800
commit49437a02c981199c62048fae00c6b80976f6e6b9 (patch)
tree5c3244fe0cd41774a2ed9bc776e348192abe1492 /core/state/state_object.go
parentb319f027a0be232a9cb307336b0349b36737c7f1 (diff)
downloadgo-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar.gz
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar.bz2
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar.lz
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar.xz
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.tar.zst
go-tangerine-49437a02c981199c62048fae00c6b80976f6e6b9.zip
core/state: make TestSnapshotRandom work again (#3816)
In `touch` operation, only `touched` filed has been changed. Therefore in the related undo function, only `touched` field should be reverted. In addition, whether remove this obj from dirty map should depend on prevDirty flag.
Diffstat (limited to 'core/state/state_object.go')
-rw-r--r--core/state/state_object.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/state/state_object.go b/core/state/state_object.go
index 7f994ee6d..7d3315303 100644
--- a/core/state/state_object.go
+++ b/core/state/state_object.go
@@ -137,8 +137,9 @@ func (self *stateObject) markSuicided() {
func (c *stateObject) touch() {
c.db.journal = append(c.db.journal, touchChange{
- account: &c.address,
- prev: c.touched,
+ account: &c.address,
+ prev: c.touched,
+ prevDirty: c.onDirty == nil,
})
if c.onDirty != nil {
c.onDirty(c.Address())