chain: dispatch RescanFinished notification after BlockConnected
In this commit, we address a bug within the wallet when running with Neutrino where it wouldn't be able to mark it as synced with the chain due to not receiving a RescanFinished notification if it was a block behind the chain. This happened because of the order in which the notifications are delivered within the underlying Neutrino ChainService, FilteredBlockConnected gets dispatched before BlockConnected. This doesn't always work however because there is an implicit dependency between them in which BlockConnected must occur first. To address it, rather than switching the order in which the notifications are dispatched, we just check if we can dispatch the final RescanFinished notification after dispatching BlockConnected. Co-Authored-By: Roei Erez <roeierez@gmail.com>
This commit is contained in:
parent
767a7a95cf
commit
b3643ed7a9
1 changed files with 4 additions and 0 deletions
|
@ -587,6 +587,10 @@ func (s *NeutrinoClient) onBlockConnected(hash *chainhash.Hash, height int32,
|
|||
case <-s.rescanQuit:
|
||||
}
|
||||
}
|
||||
|
||||
// Check if we're able to dispatch our final RescanFinished notification
|
||||
// after processing this block.
|
||||
s.dispatchRescanFinished()
|
||||
}
|
||||
|
||||
// dispatchRescanFinished determines whether we're able to dispatch our final
|
||||
|
|
Loading…
Reference in a new issue