Moved 0 check to state object for now

This commit is contained in:
obscuren
2014-06-20 20:11:40 +02:00
parent 0251fae5cc
commit 7fb5e993e3
2 changed files with 21 additions and 12 deletions

View File

@@ -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)
}