From b5b860282004848f2bb304f03672a3b299b99cf5 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Thu, 20 Sep 2018 18:47:04 -0700 Subject: [PATCH] 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. --- chainntnfs/neutrinonotify/neutrino.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chainntnfs/neutrinonotify/neutrino.go b/chainntnfs/neutrinonotify/neutrino.go index a0e999d08..75135bb0c 100644 --- a/chainntnfs/neutrinonotify/neutrino.go +++ b/chainntnfs/neutrinonotify/neutrino.go @@ -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 {