aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-06-21 02:11:40 +0800
committerobscuren <geffobscura@gmail.com>2014-06-21 02:11:40 +0800
commit7fb5e993e3a1cc2251bba7af1c85ed1d024b4b50 (patch)
tree11a2b586b466fd6a43eac6c9c9166ca7930fb62a /ethchain/state_object.go
parent0251fae5ccf6984c558d59cd2b36ef89116c061e (diff)
downloadgo-tangerine-7fb5e993e3a1cc2251bba7af1c85ed1d024b4b50.tar.gz
go-tangerine-7fb5e993e3a1cc2251bba7af1c85ed1d024b4b50.tar.zst
go-tangerine-7fb5e993e3a1cc2251bba7af1c85ed1d024b4b50.zip
Moved 0 check to state object for now
Diffstat (limited to 'ethchain/state_object.go')
-rw-r--r--ethchain/state_object.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/ethchain/state_object.go b/ethchain/state_object.go
index 5b64c3b37..17391963f 100644
--- a/ethchain/state_object.go
+++ b/ethchain/state_object.go
@@ -90,6 +90,13 @@ func (c *StateObject) SetAddr(addr []byte, value interface{}) {
func (c *StateObject) SetStorage(num *big.Int, val *ethutil.Value) {
addr := ethutil.BigToBytes(num, 256)
+
+ // FIXME This should be handled in the Trie it self
+ if val.BigInt().Cmp(ethutil.Big0) == 0 {
+ c.state.trie.Delete(string(addr))
+ return
+ }
+
//fmt.Printf("sstore %x => %v\n", addr, val)
c.SetAddr(addr, val)
}