diff options
author | gary rong <garyrong0905@gmail.com> | 2018-08-28 15:08:16 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2018-08-28 15:08:16 +0800 |
commit | b69476b372a26679e5bdb33db3d508f2c955e7ff (patch) | |
tree | 47757ef2b65302f19aca96327b7a34ad73f652a5 /les/odr.go | |
parent | c64d72bea207ccaca3f6aded25d8730a4b8696cd (diff) | |
download | dexon-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.gz dexon-b69476b372a26679e5bdb33db3d508f2c955e7ff.tar.zst dexon-b69476b372a26679e5bdb33db3d508f2c955e7ff.zip |
all: make indexer configurable (#17188)
Diffstat (limited to 'les/odr.go')
-rw-r--r-- | les/odr.go | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/les/odr.go b/les/odr.go index 2ad28d5d9..9def05a67 100644 --- a/les/odr.go +++ b/les/odr.go @@ -28,16 +28,18 @@ import ( // LesOdr implements light.OdrBackend type LesOdr struct { db ethdb.Database + indexerConfig *light.IndexerConfig chtIndexer, bloomTrieIndexer, bloomIndexer *core.ChainIndexer retriever *retrieveManager stop chan struct{} } -func NewLesOdr(db ethdb.Database, retriever *retrieveManager) *LesOdr { +func NewLesOdr(db ethdb.Database, config *light.IndexerConfig, retriever *retrieveManager) *LesOdr { return &LesOdr{ - db: db, - retriever: retriever, - stop: make(chan struct{}), + db: db, + indexerConfig: config, + retriever: retriever, + stop: make(chan struct{}), } } @@ -73,6 +75,11 @@ func (odr *LesOdr) BloomIndexer() *core.ChainIndexer { return odr.bloomIndexer } +// IndexerConfig returns the indexer config. +func (odr *LesOdr) IndexerConfig() *light.IndexerConfig { + return odr.indexerConfig +} + const ( MsgBlockBodies = iota MsgCode |