diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-09-06 18:00:35 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-06 18:00:35 +0800 |
commit | c4d21bc8e548d909d5b2940cb00d3d068f5697ec (patch) | |
tree | 1747315b32a6c9d9158fb9f36cfbd2277672ddfb /eth/api_backend.go | |
parent | 160add8570ea1653b46cc1f7c21cb6eb69220f7d (diff) | |
parent | 564c8f3ae6f80d039ef27479e5ad15145f488710 (diff) | |
download | dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.gz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.bz2 dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.lz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.xz dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.tar.zst dexon-c4d21bc8e548d909d5b2940cb00d3d068f5697ec.zip |
Merge pull request #14631 from zsfelfoldi/bloombits2
core/bloombits, eth/filter: transformed bloom bitmap based log search
Diffstat (limited to 'eth/api_backend.go')
-rw-r--r-- | eth/api_backend.go | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/eth/api_backend.go b/eth/api_backend.go index 19ef79f23..91f392f94 100644 --- a/eth/api_backend.go +++ b/eth/api_backend.go @@ -24,6 +24,7 @@ import ( "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" @@ -194,3 +195,14 @@ func (b *EthApiBackend) EventMux() *event.TypeMux { func (b *EthApiBackend) AccountManager() *accounts.Manager { return b.eth.AccountManager() } + +func (b *EthApiBackend) BloomStatus() (uint64, uint64) { + sections, _, _ := b.eth.bloomIndexer.Sections() + return params.BloomBitsBlocks, sections +} + +func (b *EthApiBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession) { + for i := 0; i < bloomFilterThreads; i++ { + go session.Multiplex(bloomRetrievalBatch, bloomRetrievalWait, b.eth.bloomRequests) + } +} |