aboutsummaryrefslogtreecommitdiffstats
path: root/ethchain/state_object.go
diff options
context:
space:
mode:
authorzelig <viktor.tron@gmail.com>2014-06-23 20:07:43 +0800
committerzelig <viktor.tron@gmail.com>2014-06-23 20:07:43 +0800
commitf58c7ac5a6f5d77649c1c07dce94bf6d5c146c31 (patch)
tree31e286974108e02b29ed5eff0a73646f605998c2 /ethchain/state_object.go
parent63157c798d613f1ca638597515bb89768e2c1aad (diff)
parentd890258af6de8c5ef9701826fb4ee7c353788ad5 (diff)
downloaddexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.gz
dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.tar.zst
dexon-f58c7ac5a6f5d77649c1c07dce94bf6d5c146c31.zip
merge upstream
Diffstat (limited to 'ethchain/state_object.go')
-rw-r--r--ethchain/state_object.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/ethchain/state_object.go b/ethchain/state_object.go
index f53f47d7e..7d7352af4 100644
--- a/ethchain/state_object.go
+++ b/ethchain/state_object.go
@@ -90,7 +90,14 @@ func (c *StateObject) SetAddr(addr []byte, value interface{}) {
func (c *StateObject) SetStorage(num *big.Int, val *ethutil.Value) {
addr := ethutil.BigToBytes(num, 256)
- //fmt.Printf("sstore %x => %v\n", addr, val)
+
+ // FIXME This should be handled in the Trie it self
+ if val.BigInt().Cmp(ethutil.Big0) == 0 {
+ c.state.trie.Delete(string(addr))
+
+ return
+ }
+
c.SetAddr(addr, val)
}