mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 17:51:33 +02:00
discovery/syncer: add flag to prevent historical gossip filter dump
This commit is contained in:
@@ -235,6 +235,12 @@ type gossipSyncerCfg struct {
|
||||
// replyHandler, meaning we will not reply to queries from our remote
|
||||
// peer.
|
||||
noReplyQueries bool
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
// GossipSyncer is a struct that handles synchronizing the channel graph state
|
||||
@@ -951,6 +957,12 @@ func (g *GossipSyncer) ApplyGossipFilter(filter *lnwire.GossipTimestampRange) er
|
||||
|
||||
g.Unlock()
|
||||
|
||||
// If requested, don't reply with historical gossip data when the remote
|
||||
// peer sets their gossip timestamp range.
|
||||
if g.cfg.ignoreHistoricalFilters {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Now that the remote peer has applied their filter, we'll query the
|
||||
// database for all the messages that are beyond this filter.
|
||||
newUpdatestoSend, err := g.cfg.channelSeries.UpdatesInHorizon(
|
||||
|
Reference in New Issue
Block a user