From 76c9c8d653ae49e347598f1bbd34c821354c9567 Mon Sep 17 00:00:00 2001 From: obscuren Date: Mon, 3 Nov 2014 00:31:15 +0100 Subject: Compress data on db level. Closes #174 --- state/state_object.go | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'state/state_object.go') diff --git a/state/state_object.go b/state/state_object.go index aa5c13678..472aa8389 100644 --- a/state/state_object.go +++ b/state/state_object.go @@ -297,23 +297,11 @@ func (self *StateObject) CreateOutputForDiff() { // State object encoding methods func (c *StateObject) RlpEncode() []byte { - var root interface{} - if c.State != nil { - root = c.State.Trie.Root - } else { - root = "" - } - - return ethutil.Encode([]interface{}{c.Nonce, c.balance, root, c.CodeHash()}) + return ethutil.Encode([]interface{}{c.Nonce, c.balance, c.State.Trie.Root, c.CodeHash()}) } func (c *StateObject) CodeHash() ethutil.Bytes { - var codeHash []byte - if len(c.Code) > 0 { - codeHash = crypto.Sha3(c.Code) - } - - return codeHash + return crypto.Sha3(c.Code) } func (c *StateObject) RlpDecode(data []byte) { -- cgit v1.2.3