discovery: limit NumBlocks to best known height for outgoing QueryChannelRange
This is done to ensure we don't receive replies for channels in blocks not currently known to us, which we wouldn't be able to process.
This commit is contained in:
5 files changed
+54
-23
No files matched your search
@@ -89,6 +89,9 @@ type SyncManagerCfg struct {
|
||||
// This prevents ranges with old start times from causing us to dump the
|
||||
// graph on connect.
|
||||
IgnoreHistoricalFilters bool
|
||||
|
||||
// BestHeight returns the latest height known of the chain.
|
||||
BestHeight func() uint32
|
||||
}
|
||||
|
||||
// SyncManager is a subsystem of the gossiper that manages the gossip syncers
|
||||
@@ -419,7 +422,10 @@ func (m *SyncManager) createGossipSyncer(peer lnpeer.Peer) *GossipSyncer {
|
||||
sendToPeerSync: func(msgs ...lnwire.Message) error {
|
||||
return peer.SendMessageLazy(true, msgs...)
|
||||
},
|
||||
ignoreHistoricalFilters: m.cfg.IgnoreHistoricalFilters,
|
||||
ignoreHistoricalFilters: m.cfg.IgnoreHistoricalFilters,
|
||||
maxUndelayedQueryReplies: DefaultMaxUndelayedQueryReplies,
|
||||
delayedQueryReplyInterval: DefaultDelayedQueryReplyInterval,
|
||||
bestHeight: m.cfg.BestHeight,
|
||||
})
|
||||
|
||||
// Gossip syncers are initialized by default in a PassiveSync type
|
||||
|
||||
Reference in new issue
Block a user