aboutsummaryrefslogtreecommitdiffstats
path: root/les
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2017-08-29 19:13:11 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-09-06 16:14:19 +0800
commitf585f9eee8cb18423c23fe8b517b5b4cbe3b3755 (patch)
tree08c232ee58318c20f971cf8e3f5dfa09f1e2caf7 /les
parent4ea4d2dc3473afd9d2eda6ef6b359accce1f0946 (diff)
downloadgo-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar.gz
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar.bz2
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar.lz
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar.xz
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.tar.zst
go-tangerine-f585f9eee8cb18423c23fe8b517b5b4cbe3b3755.zip
core, eth: clean up bloom filtering, add some tests
Diffstat (limited to 'les')
-rw-r--r--les/api_backend.go18
-rw-r--r--les/backend.go2
2 files changed, 5 insertions, 15 deletions
diff --git a/les/api_backend.go b/les/api_backend.go
index c2ba27028..0d2d31b67 100644
--- a/les/api_backend.go
+++ b/les/api_backend.go
@@ -19,17 +19,16 @@ package les
import (
"context"
"math/big"
- "time"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/math"
"github.com/ethereum/go-ethereum/core"
+ "github.com/ethereum/go-ethereum/core/bloombits"
"github.com/ethereum/go-ethereum/core/state"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/core/vm"
"github.com/ethereum/go-ethereum/eth/downloader"
- "github.com/ethereum/go-ethereum/eth/filters"
"github.com/ethereum/go-ethereum/eth/gasprice"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/event"
@@ -174,18 +173,9 @@ func (b *LesApiBackend) AccountManager() *accounts.Manager {
return b.eth.accountManager
}
-func (b *LesApiBackend) GetBloomBits(ctx context.Context, bitIdx uint64, sectionIdxList []uint64) ([][]byte, error) {
- return nil, nil // implemented in a subsequent PR
+func (b *LesApiBackend) BloomStatus() (uint64, uint64) {
+ return params.BloomBitsBlocks, 0
}
-func (b *LesApiBackend) BloomBitsSections() uint64 {
- return 0
-}
-
-func (b *LesApiBackend) BloomBitsConfig() filters.BloomConfig {
- return filters.BloomConfig{
- SectionSize: 32768,
- MaxRequestLen: 16,
- MaxRequestWait: time.Microsecond * 100,
- }
+func (b *LesApiBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) {
}
diff --git a/les/backend.go b/les/backend.go
index a3670b5ac..4c33417c0 100644
--- a/les/backend.go
+++ b/les/backend.go
@@ -169,7 +169,7 @@ func (s *LightEthereum) APIs() []rpc.API {
}, {
Namespace: "eth",
Version: "1.0",
- Service: filters.NewPublicFilterAPI(s.ApiBackend, true, 0),
+ Service: filters.NewPublicFilterAPI(s.ApiBackend, true),
Public: true,
}, {
Namespace: "net",