From 51216c6e5ee0fef421fb2cd6e869298f3e8549d1 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 13 Aug 2019 17:40:18 -0700 Subject: [PATCH 1/2] cmd/lncli: properly set synced_to_graph for getinfo command --- cmd/lncli/commands.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/lncli/commands.go b/cmd/lncli/commands.go index 45e06a51..7457284d 100644 --- a/cmd/lncli/commands.go +++ b/cmd/lncli/commands.go @@ -1879,6 +1879,7 @@ func getInfo(ctx *cli.Context) error { BlockHash string `json:"block_hash"` BestHeaderTimestamp int64 `json:"best_header_timestamp"` SyncedToChain bool `json:"synced_to_chain"` + SyncedToGraph bool `json:"synced_to_graph"` Testnet bool `json:"testnet"` Chains []chain `json:"chains"` Uris []string `json:"uris"` @@ -1895,6 +1896,7 @@ func getInfo(ctx *cli.Context) error { BlockHash: resp.BlockHash, BestHeaderTimestamp: resp.BestHeaderTimestamp, SyncedToChain: resp.SyncedToChain, + SyncedToGraph: resp.SyncedToGraph, Testnet: resp.Testnet, Chains: chains, Uris: resp.Uris, From c405e8919712b38c14c367fed1eb46042a2c10b5 Mon Sep 17 00:00:00 2001 From: Wilmer Paulino Date: Tue, 13 Aug 2019 18:23:05 -0700 Subject: [PATCH 2/2] discovery: check non-nil syncer upon historical sync tick --- discovery/sync_manager.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/discovery/sync_manager.go b/discovery/sync_manager.go index b9a18763..059e415d 100644 --- a/discovery/sync_manager.go +++ b/discovery/sync_manager.go @@ -383,9 +383,10 @@ func (m *SyncManager) syncerHandler() { case <-m.cfg.HistoricalSyncTicker.Ticks(): s := m.forceHistoricalSync() - // If we've already performed our initial historical - // sync, then we have nothing left to do. - if m.IsGraphSynced() { + // If we don't have a syncer available or we've already + // performed our initial historical sync, then we have + // nothing left to do. + if s == nil || m.IsGraphSynced() { continue }