Skip to content

Commit

Permalink
les: start bloombits indexer in light mode
Browse files Browse the repository at this point in the history
  • Loading branch information
zsfelfoldi committed Oct 11, 2017
1 parent 7216e44 commit 21983ec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions core/chain_indexer.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,9 @@ func (c *ChainIndexer) eventLoop(currentHeader *types.Header, ch chan ChainEvent
}
header := ev.Block.Header()
if header.ParentHash != prevHash {
var rollbackNum uint64
if h := FindCommonAncestor(c.chainDb, prevHeader, header); h != nil {
rollbackNum = h.Number.Uint64()
c.newHead(h.Number.Uint64(), true)
}
c.newHead(rollbackNum, true)
}
c.newHead(header.Number.Uint64(), false)

Expand Down
1 change: 1 addition & 0 deletions les/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ func New(ctx *node.ServiceContext, config *eth.Config) (*LightEthereum, error) {
if leth.blockchain, err = light.NewLightChain(leth.odr, leth.chainConfig, leth.engine); err != nil {
return nil, err
}
leth.bbIndexer.Start(leth.blockchain)
// Rewind the chain in case of an incompatible config upgrade.
if compat, ok := genesisErr.(*params.ConfigCompatError); ok {
log.Warn("Rewinding chain to upgrade configuration", "err", compat)
Expand Down

0 comments on commit 21983ec

Please sign in to comment.