chainntnfs/neutrinonotify/neutrino: remove height shadowing

This commit removes shadowing of the currentHeight
variable when registering for neutrino spend
notifications. Currently, a locally scoped variable
is used when determining if the backend is fully
synced before attempting to call GetUtxo, which
means that the variable won't be updated after
breaking out of the loop. As a result, this could
cause us to scan unnecessarily if the backend is
catching up, e.g. after being offline for some time.
This commit is contained in:
Conner Fromknecht 2018-09-20 18:47:04 -07:00
parent 6d759bd8d9
commit b5b8602820
No known key found for this signature in database
GPG Key ID: E7D737B67FA592C7

@ -814,7 +814,7 @@ func (n *NeutrinoNotifier) RegisterSpendNtfn(outpoint *wire.OutPoint,
// may miss a notification dispatch.
for {
n.heightMtx.RLock()
currentHeight := n.bestHeight
currentHeight = n.bestHeight
n.heightMtx.RUnlock()
if currentHeight < heightHint {