From 8cebddfe5079add6e96606300383882414a5b474 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 30 Jul 2019 17:25:47 -0700 Subject: [PATCH] discovery/gossiper: thread IgnoreHistoricalFilters to sync manager --- discovery/gossiper.go | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/discovery/gossiper.go b/discovery/gossiper.go index a3aefd48c..8372772fd 100644 --- a/discovery/gossiper.go +++ b/discovery/gossiper.go @@ -211,6 +211,12 @@ type Config struct { // SubBatchDelay is the delay between sending sub batches of // gossip messages. SubBatchDelay time.Duration + + // IgnoreHistoricalFilters will prevent syncers from replying with + // historical data when the remote peer sets a gossip_timestamp_range. + // This prevents ranges with old start times from causing us to dump the + // graph on connect. + IgnoreHistoricalFilters bool } // AuthenticatedGossiper is a subsystem which is responsible for receiving @@ -313,11 +319,12 @@ func New(cfg Config, selfKey *btcec.PublicKey) *AuthenticatedGossiper { channelMtx: multimutex.NewMutex(), recentRejects: make(map[uint64]struct{}), syncMgr: newSyncManager(&SyncManagerCfg{ - ChainHash: cfg.ChainHash, - ChanSeries: cfg.ChanSeries, - RotateTicker: cfg.RotateTicker, - HistoricalSyncTicker: cfg.HistoricalSyncTicker, - NumActiveSyncers: cfg.NumActiveSyncers, + ChainHash: cfg.ChainHash, + ChanSeries: cfg.ChanSeries, + RotateTicker: cfg.RotateTicker, + HistoricalSyncTicker: cfg.HistoricalSyncTicker, + NumActiveSyncers: cfg.NumActiveSyncers, + IgnoreHistoricalFilters: cfg.IgnoreHistoricalFilters, }), }