blockchain/indexers: fix bug in indexer re-org catch up

In this commit, we fix an existing bug in the re-org catch up logic for
the `IndexManager`. Before this commit, we would assign the block to the
_local_ scope rather than the outer scope. As a result, we would never
properly bisect the chain to find the fork point to be able to reconcile
the index state to the main chain only after a re-org occurs.

Fixes #1261
This commit is contained in:
Olaoluwa Osuntokun 2018-08-22 19:46:27 -07:00
parent 9d15e63c50
commit be191ca111
No known key found for this signature in database
GPG key ID: 964EA263DD637C21

View file

@ -309,7 +309,7 @@ func (m *Manager) Init(chain *blockchain.BlockChain, interrupt <-chan struct{})
if err != nil {
return err
}
block, err := btcutil.NewBlockFromBytes(blockBytes)
block, err = btcutil.NewBlockFromBytes(blockBytes)
if err != nil {
return err
}