Compress data on db level. Closes #174

This commit is contained in:
obscuren
2014-11-03 00:31:15 +01:00
parent bd4f51ff3c
commit 76c9c8d653
3 changed files with 62 additions and 35 deletions

View File

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