aboutsummaryrefslogtreecommitdiffstats
path: root/core/state/state_object.go
diff options
context:
space:
mode:
authorMartin Holst Swende <martin@swende.se>2018-08-12 20:47:03 +0800
committerPéter Szilágyi <peterke@gmail.com>2018-09-18 18:08:32 +0800
commitcaa2c23a38141911a570ba098a940b4fdbf0aa88 (patch)
treedf85df9790ac43a17d16b08538eb6c629efb7af7 /core/state/state_object.go
parent58374e28d95c03d8b0e6d9035c0fb92fad3e865e (diff)
downloadgo-tangerine-caa2c23a38141911a570ba098a940b4fdbf0aa88.tar.gz
go-tangerine-caa2c23a38141911a570ba098a940b4fdbf0aa88.tar.zst
go-tangerine-caa2c23a38141911a570ba098a940b4fdbf0aa88.zip
core,state: finish implementing Eip 1283
Diffstat (limited to 'core/state/state_object.go')
-rw-r--r--core/state/state_object.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/state/state_object.go b/core/state/state_object.go
index 0b72d0114..b05afec93 100644
--- a/core/state/state_object.go
+++ b/core/state/state_object.go
@@ -183,6 +183,16 @@ func (self *stateObject) GetState(db Database, key common.Hash) common.Hash {
return value
}
+// GetOriginalStateValue returns the state value that is currently in the Trie, that is, ignoring any
+// changes that have been made but not yet written to trie.
+func (self *stateObject) GetOriginalStateValue(db Database, key common.Hash) common.Hash{
+ if original, exist:= self.originalValue[key]; exist {
+ // original value has been set, return it
+ return original
+ }
+ return self.GetState(db, key)
+}
+
// SetState updates a value in account storage.
func (self *stateObject) SetState(db Database, key, value common.Hash) {
prev := self.GetState(db, key)