From be191ca111b494bb1ccdbeb7295723ee56949d07 Mon Sep 17 00:00:00 2001 From: Olaoluwa Osuntokun Date: Wed, 22 Aug 2018 19:46:27 -0700 Subject: [PATCH] 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 --- blockchain/indexers/manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blockchain/indexers/manager.go b/blockchain/indexers/manager.go index 09dae621..bc0804f8 100644 --- a/blockchain/indexers/manager.go +++ b/blockchain/indexers/manager.go @@ -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 }