瀏覽代碼

core/state: remove the need for common.Value

obscuren 10 年之前
父節點
當前提交
30b27336ea
共有 1 個文件被更改,包括 4 次插入2 次删除
  1. 4 2
      core/state/state_object.go

+ 4 - 2
core/state/state_object.go

@@ -128,8 +128,10 @@ func (self *StateObject) MarkForDeletion() {
 	}
 }
 
-func (c *StateObject) getAddr(addr common.Hash) (ret common.Hash) {
-	return common.BytesToHash(common.NewValueFromBytes([]byte(c.State.trie.Get(addr[:]))).Bytes())
+func (c *StateObject) getAddr(addr common.Hash) common.Hash {
+	var ret []byte
+	rlp.DecodeBytes(c.State.trie.Get(addr[:]), &ret)
+	return common.BytesToHash(ret)
 }
 
 func (c *StateObject) setAddr(addr []byte, value common.Hash) {