aboutsummaryrefslogtreecommitdiffstats
path: root/eth/backend.go
diff options
context:
space:
mode:
authorZsolt Felfoldi <zsfelfoldi@gmail.com>2017-08-19 03:52:20 +0800
committerPéter Szilágyi <peterke@gmail.com>2017-09-06 16:13:13 +0800
commit4ea4d2dc3473afd9d2eda6ef6b359accce1f0946 (patch)
treee651cfc2e3aa36083b333bf34dc3cccef2623f26 /eth/backend.go
parent1e67378df879b1ce566f17dd95a3b126056254b5 (diff)
downloadgo-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar.gz
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar.bz2
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar.lz
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar.xz
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.tar.zst
go-tangerine-4ea4d2dc3473afd9d2eda6ef6b359accce1f0946.zip
core, eth: add bloombit indexer, filter based on it
Diffstat (limited to 'eth/backend.go')
-rw-r--r--eth/backend.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/eth/backend.go b/eth/backend.go
index 5837c8564..efc0a2317 100644
--- a/eth/backend.go
+++ b/eth/backend.go
@@ -77,6 +77,8 @@ type Ethereum struct {
engine consensus.Engine
accountManager *accounts.Manager
+ bbIndexer *core.ChainIndexer
+
ApiBackend *EthApiBackend
miner *miner.Miner
@@ -125,11 +127,9 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
networkId: config.NetworkId,
gasPrice: config.GasPrice,
etherbase: config.Etherbase,
+ bbIndexer: NewBloomBitsProcessor(chainDb, bloomBitsSection),
}
- if err := addMipmapBloomBins(chainDb); err != nil {
- return nil, err
- }
log.Info("Initialising Ethereum protocol", "versions", ProtocolVersions, "network", config.NetworkId)
if !config.SkipBcVersionCheck {
@@ -151,6 +151,7 @@ func New(ctx *node.ServiceContext, config *Config) (*Ethereum, error) {
eth.blockchain.SetHead(compat.RewindTo)
core.WriteChainConfig(chainDb, genesisHash, chainConfig)
}
+ eth.bbIndexer.Start(eth.blockchain)
if config.TxPool.Journal != "" {
config.TxPool.Journal = ctx.ResolvePath(config.TxPool.Journal)
@@ -260,7 +261,7 @@ func (s *Ethereum) APIs() []rpc.API {
}, {
Namespace: "eth",
Version: "1.0",
- Service: filters.NewPublicFilterAPI(s.ApiBackend, false),
+ Service: filters.NewPublicFilterAPI(s.ApiBackend, false, bloomBitsSection),
Public: true,
}, {
Namespace: "admin",
@@ -389,6 +390,7 @@ func (s *Ethereum) Stop() error {
if s.stopDbUpgrade != nil {
s.stopDbUpgrade()
}
+ s.bbIndexer.Close()
s.blockchain.Stop()
s.protocolManager.Stop()
if s.lesServer != nil {