discovery: replace GossipSyncer syncChanUpdates flag with SyncerType

In this commit, we introduce a new type: SyncerType. This type denotes
the type of sync a GossipSyncer is currently under. We only introduce
the two possible entry states, ActiveSync and PassiveSync. An ActiveSync
GossipSyncer will exchange channels with the remote peer and receive new
graph updates from them, while a PassiveSync GossipSyncer will not and
will only response to the remote peer's queries.

This commit does not modify the behavior and is only meant to be a
refactor.
This commit is contained in:
Wilmer Paulino committed 2019-04-03 15:08:27 -07:00
1 parent 7e92b9a4e2
commit 8d7c0a9899
3 files changed
+84 -25

No files matched your search

+3 -4
View File
@@ -120,10 +120,9 @@ func newTestSyncer(hID lnwire.ShortChannelID,
msgChan := make(chan []lnwire.Message, 20)
cfg := gossipSyncerCfg{
syncChanUpdates: true,
channelSeries: newMockChannelGraphTimeSeries(hID),
encodingType: encodingType,
chunkSize: chunkSize,
channelSeries: newMockChannelGraphTimeSeries(hID),
encodingType: encodingType,
chunkSize: chunkSize,
sendToPeer: func(msgs ...lnwire.Message) error {
msgChan <- msgs
return nil