config: expose gossip.pinned-syncers for conf

The pinned syncer set is exposed as a comma-separated list of pubkeys.
This commit is contained in:
Conner Fromknecht
2021-01-29 00:14:21 -08:00
parent 2371fc5a8e
commit fcd5cb625a
5 changed files with 59 additions and 0 deletions

View File

@@ -237,6 +237,11 @@ type Config struct {
// gossip updates to once per RebroadcastInterval for any keep-alive
// updates, and once per block for other types of updates.
GossipUpdateThrottle bool
// PinnedSyncers is a set of peers that will always transition to
// ActiveSync upon connection. These peers will never transition to
// PassiveSync.
PinnedSyncers PinnedSyncers
}
// AuthenticatedGossiper is a subsystem which is responsible for receiving
@@ -338,6 +343,7 @@ func New(cfg Config, selfKey *btcec.PublicKey) *AuthenticatedGossiper {
NumActiveSyncers: cfg.NumActiveSyncers,
IgnoreHistoricalFilters: cfg.IgnoreHistoricalFilters,
BestHeight: gossiper.latestHeight,
PinnedSyncers: cfg.PinnedSyncers,
})
gossiper.reliableSender = newReliableSender(&reliableSenderCfg{