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:
3 files changed
+84
-25
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user