aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm_env.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-06-11 18:32:39 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-06-11 18:32:39 +0800
commit6609d45ef48ce1c2d2b0e73fa8fe5190d36e3920 (patch)
tree5cb56f1a9ce712178bd19886c389166562f6f328 /core/vm_env.go
parent13bd452fafae000b5b3d5769af5554de7c5f9779 (diff)
parent37111aa4bd215cfc8bcfb97cdc7e223649306196 (diff)
downloaddexon-6609d45ef48ce1c2d2b0e73fa8fe5190d36e3920.tar.gz
dexon-6609d45ef48ce1c2d2b0e73fa8fe5190d36e3920.tar.zst
dexon-6609d45ef48ce1c2d2b0e73fa8fe5190d36e3920.zip
Merge pull request #1228 from obscuren/vm-optimisations
core/vm: optimisations
Diffstat (limited to 'core/vm_env.go')
-rw-r--r--core/vm_env.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/core/vm_env.go b/core/vm_env.go
index c439d2946..da862d5c8 100644
--- a/core/vm_env.go
+++ b/core/vm_env.go
@@ -16,6 +16,8 @@ type VMEnv struct {
depth int
chain *ChainManager
typ vm.Type
+ // structured logging
+ logs []vm.StructLog
}
func NewEnv(state *state.StateDB, chain *ChainManager, msg Message, block *types.Block) *VMEnv {
@@ -47,6 +49,7 @@ func (self *VMEnv) GetHash(n uint64) common.Hash {
return common.Hash{}
}
+
func (self *VMEnv) AddLog(log *state.Log) {
self.state.AddLog(log)
}
@@ -68,3 +71,11 @@ func (self *VMEnv) Create(me vm.ContextRef, data []byte, gas, price, value *big.
exe := NewExecution(self, nil, data, gas, price, value)
return exe.Create(me)
}
+
+func (self *VMEnv) StructLogs() []vm.StructLog {
+ return self.logs
+}
+
+func (self *VMEnv) AddStructLog(log vm.StructLog) {
+ self.logs = append(self.logs, log)
+}