aboutsummaryrefslogtreecommitdiffstats
path: root/ethstate/state_object.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-09-08 06:50:04 +0800
committerobscuren <geffobscura@gmail.com>2014-09-08 06:50:04 +0800
commitd91357d00ca080c63d81570504e5c45fb15e3841 (patch)
tree43abf8cb592bf3e59c8d99c4b027028734f9497d /ethstate/state_object.go
parent0fea62ec6d33a83e602c804ee4b5b0a7896fd9c6 (diff)
downloaddexon-d91357d00ca080c63d81570504e5c45fb15e3841.tar.gz
dexon-d91357d00ca080c63d81570504e5c45fb15e3841.tar.zst
dexon-d91357d00ca080c63d81570504e5c45fb15e3841.zip
Added GetCode method
Diffstat (limited to 'ethstate/state_object.go')
-rw-r--r--ethstate/state_object.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/ethstate/state_object.go b/ethstate/state_object.go
index bf4e92583..6fc0696a8 100644
--- a/ethstate/state_object.go
+++ b/ethstate/state_object.go
@@ -297,8 +297,12 @@ func (c *StateObject) RlpEncode() []byte {
} else {
root = ""
}
+ var codeHash []byte
+ if len(c.Code) > 0 {
+ codeHash = ethcrypto.Sha3Bin(c.Code)
+ }
- return ethutil.Encode([]interface{}{c.Nonce, c.Balance, root, ethcrypto.Sha3Bin(c.Code)})
+ return ethutil.Encode([]interface{}{c.Nonce, c.Balance, root, codeHash})
}
func (c *StateObject) RlpDecode(data []byte) {