aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-05-21 04:44:05 +0800
committerobscuren <geffobscura@gmail.com>2014-05-21 04:44:05 +0800
commit47fd4833eea70709e11df19b72ed59149dc95417 (patch)
tree4ac7be0f58dfb37c8302277673ab2b4cb79a01ac
parent7dae955c1a66792bd345c24bace22b69cff8f8a9 (diff)
parent64701e388c3f603a4fad5b6ff45ba2633b3f645e (diff)
downloadgo-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar.gz
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar.bz2
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar.lz
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar.xz
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.tar.zst
go-tangerine-47fd4833eea70709e11df19b72ed59149dc95417.zip
Merge branch 'hotfix/3'
-rw-r--r--ethchain/state.go3
-rw-r--r--ethpub/types.go8
2 files changed, 8 insertions, 3 deletions
diff --git a/ethchain/state.go b/ethchain/state.go
index 63c4a32a6..db715f1cb 100644
--- a/ethchain/state.go
+++ b/ethchain/state.go
@@ -61,9 +61,6 @@ func (s *State) GetStateObject(addr []byte) *StateObject {
cachedStateObject := s.states[string(addr)]
if cachedStateObject != nil {
stateObject.state = cachedStateObject
- } else {
- // If it isn't cached, cache the state
- s.states[string(addr)] = stateObject.state
}
return stateObject
diff --git a/ethpub/types.go b/ethpub/types.go
index 5d3bfcaaa..77cca78b9 100644
--- a/ethpub/types.go
+++ b/ethpub/types.go
@@ -104,6 +104,14 @@ func (c *PStateObject) Nonce() int {
return 0
}
+func (c *PStateObject) Root() string {
+ if c.object != nil {
+ return ethutil.Hex(ethutil.NewValue(c.object.State().Root()).Bytes())
+ }
+
+ return "<err>"
+}
+
func (c *PStateObject) IsContract() bool {
if c.object != nil {
return len(c.object.Script()) > 0