aboutsummaryrefslogtreecommitdiffstats
path: root/state
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-11-03 07:31:15 +0800
committerobscuren <geffobscura@gmail.com>2014-11-03 07:31:15 +0800
commit76c9c8d653ae49e347598f1bbd34c821354c9567 (patch)
tree0d9fab91ab28cecb55e941fb0adf5de36dc8459a /state
parentbd4f51ff3c75c186dbc8a71439953c8fc05b16cd (diff)
downloaddexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar.gz
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar.bz2
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar.lz
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar.xz
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.tar.zst
dexon-76c9c8d653ae49e347598f1bbd34c821354c9567.zip
Compress data on db level. Closes #174
Diffstat (limited to 'state')
-rw-r--r--state/state_object.go16
1 files changed, 2 insertions, 14 deletions
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) {