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.
This commit is contained in:
obscuren
2015-04-08 17:14:58 +02:00
parent 6284604b52
commit 1c872ddf4b
12 changed files with 83 additions and 122 deletions

View File

@ -393,7 +393,7 @@ func (self *XEth) NewFilterString(word string) int {
self.logMut.Lock()
defer self.logMut.Unlock()
self.logs[id].add(&state.StateLog{})
self.logs[id].add(&state.Log{})
}
case "latest":
filter.BlockCallback = func(block *types.Block, logs state.Logs) {
@ -403,7 +403,7 @@ func (self *XEth) NewFilterString(word string) int {
for _, log := range logs {
self.logs[id].add(log)
}
self.logs[id].add(&state.StateLog{})
self.logs[id].add(&state.Log{})
}
}
@ -729,7 +729,7 @@ type logFilter struct {
id int
}
func (l *logFilter) add(logs ...state.Log) {
func (l *logFilter) add(logs ...*state.Log) {
l.logs = append(l.logs, logs...)
}