From d53335a43d93ac13b9612a46411ffa02296912bd Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Sun, 19 Aug 2018 15:16:29 +0200 Subject: [PATCH] fix(lnd): don't treat filters as filter headers During the sync process there are log message that relate to syncing filters and filter headers. This fixes an issue where we were parsing messages about syncing filters as if they were filter headers, which would cause the progress indicator to jump around during the middle of the sync process due to it thinking that more filter headers had been synced than was actually the case. --- app/lib/lnd/neutrino.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/app/lib/lnd/neutrino.js b/app/lib/lnd/neutrino.js index fb5caced..17757e5b 100644 --- a/app/lib/lnd/neutrino.js +++ b/app/lib/lnd/neutrino.js @@ -184,16 +184,12 @@ class Neutrino extends EventEmitter { height = match[1] } else if ((match = line.match(/Got cfheaders from height=(\d*) to height=(\d+)/))) { cfilter = match[2] + } else if ((match = line.match(/Writing filter headers up to height=(\d*)/))) { + cfilter = match[1] } else if ((match = line.match(/Verified \d* filter headers? in the.+\(height (\d+)/))) { cfilter = match[1] } - if (!this.lndCfilterHeight || this.lndCfilterHeight > this.currentBlockHeight - 10000) { - if ((match = line.match(/Fetching filter for height=(\d+)/))) { - cfilter = match[1] - } - } - if (height) { this.setState(CHAIN_SYNC_IN_PROGRESS) this.setLndBlockHeight(height)