From 1c872ddf4b1db51847a5d9d020e13d432e847f52 Mon Sep 17 00:00:00 2001 From: obscuren Date: Wed, 8 Apr 2015 17:14:58 +0200 Subject: Changed how logs are being recorded Logs are now recorded per transactions instead of tossing them out after each transaction. This should also fix an issue with `eth_getFilterLogs` (#629) Also now implemented are the `transactionHash, blockHash, transactionIndex, logIndex` on logs. Closes #654. --- core/vm/environment.go | 2 +- core/vm/vm.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'core/vm') diff --git a/core/vm/environment.go b/core/vm/environment.go index 72e18c353..cc9570fc8 100644 --- a/core/vm/environment.go +++ b/core/vm/environment.go @@ -22,7 +22,7 @@ type Environment interface { Difficulty() *big.Int GasLimit() *big.Int Transfer(from, to Account, amount *big.Int) error - AddLog(state.Log) + AddLog(*state.Log) VmType() Type diff --git a/core/vm/vm.go b/core/vm/vm.go index 118f60076..927b67293 100644 --- a/core/vm/vm.go +++ b/core/vm/vm.go @@ -557,7 +557,8 @@ func (self *Vm) Run(context *Context, callData []byte) (ret []byte, err error) { } data := mem.Get(mStart.Int64(), mSize.Int64()) - log := &Log{context.Address(), topics, data, self.env.BlockNumber().Uint64()} + log := state.NewLog(context.Address(), topics, data, self.env.BlockNumber().Uint64()) + //log := &Log{context.Address(), topics, data, self.env.BlockNumber().Uint64()} self.env.AddLog(log) self.Printf(" => %v", log) -- cgit v1.2.3