aboutsummaryrefslogtreecommitdiffstats
path: root/xeth/xeth.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <geffobscura@gmail.com>2015-10-12 23:58:51 +0800
committerJeffrey Wilcke <geffobscura@gmail.com>2015-10-17 03:28:59 +0800
commit6dc14788a238f3e0ec786c6c04d476a3b957e645 (patch)
tree8f3f5f91506bc4c7532543043add1eaea3fd28e7 /xeth/xeth.go
parent30f057aaf9891fb37f82d94c24b8aa35d388e07b (diff)
downloaddexon-6dc14788a238f3e0ec786c6c04d476a3b957e645.tar.gz
dexon-6dc14788a238f3e0ec786c6c04d476a3b957e645.tar.zst
dexon-6dc14788a238f3e0ec786c6c04d476a3b957e645.zip
core, eth/filters, miner, xeth: Optimised log filtering
Log filtering is now using a MIPmap like approach where addresses of logs are added to a mapped bloom bin. The current levels for the MIP are in ranges of 1.000.000, 500.000, 100.000, 50.000, 1.000. Logs are therefor filtered in batches of 1.000.
Diffstat (limited to 'xeth/xeth.go')
-rw-r--r--xeth/xeth.go16
1 files changed, 6 insertions, 10 deletions
diff --git a/xeth/xeth.go b/xeth/xeth.go
index 13e171270..ae03471d5 100644
--- a/xeth/xeth.go
+++ b/xeth/xeth.go
@@ -543,11 +543,9 @@ func (self *XEth) NewLogFilter(earliest, latest int64, skip, max int, address []
id := self.filterManager.Add(filter)
self.logQueue[id] = &logQueue{timeout: time.Now()}
- filter.SetEarliestBlock(earliest)
- filter.SetLatestBlock(latest)
- filter.SetSkip(skip)
- filter.SetMax(max)
- filter.SetAddress(cAddress(address))
+ filter.SetBeginBlock(earliest)
+ filter.SetEndBlock(latest)
+ filter.SetAddresses(cAddress(address))
filter.SetTopics(cTopics(topics))
filter.LogsCallback = func(logs vm.Logs) {
self.logMu.Lock()
@@ -652,11 +650,9 @@ func (self *XEth) Logs(id int) vm.Logs {
func (self *XEth) AllLogs(earliest, latest int64, skip, max int, address []string, topics [][]string) vm.Logs {
filter := filters.New(self.backend.ChainDb())
- filter.SetEarliestBlock(earliest)
- filter.SetLatestBlock(latest)
- filter.SetSkip(skip)
- filter.SetMax(max)
- filter.SetAddress(cAddress(address))
+ filter.SetBeginBlock(earliest)
+ filter.SetEndBlock(latest)
+ filter.SetAddresses(cAddress(address))
filter.SetTopics(cTopics(topics))
return filter.Find()