mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 06:07:16 +01:00
multi: extract and pass through IsZombieChannel method
This commit is contained in:
@@ -335,6 +335,11 @@ type Config struct {
|
||||
// to without iterating over the entire set of open channels.
|
||||
FindChannel func(node *btcec.PublicKey, chanID lnwire.ChannelID) (
|
||||
*channeldb.OpenChannel, error)
|
||||
|
||||
// IsStillZombieChannel takes the timestamps of the latest channel
|
||||
// updates for a channel and returns true if the channel should be
|
||||
// considered a zombie based on these timestamps.
|
||||
IsStillZombieChannel func(time.Time, time.Time) bool
|
||||
}
|
||||
|
||||
// processedNetworkMsg is a wrapper around networkMsg and a boolean. It is
|
||||
@@ -519,6 +524,7 @@ func New(cfg Config, selfKeyDesc *keychain.KeyDescriptor) *AuthenticatedGossiper
|
||||
IgnoreHistoricalFilters: cfg.IgnoreHistoricalFilters,
|
||||
BestHeight: gossiper.latestHeight,
|
||||
PinnedSyncers: cfg.PinnedSyncers,
|
||||
IsStillZombieChannel: cfg.IsStillZombieChannel,
|
||||
})
|
||||
|
||||
gossiper.reliableSender = newReliableSender(&reliableSenderCfg{
|
||||
|
||||
@@ -102,6 +102,11 @@ type SyncManagerCfg struct {
|
||||
// ActiveSync upon connection. These peers will never transition to
|
||||
// PassiveSync.
|
||||
PinnedSyncers PinnedSyncers
|
||||
|
||||
// IsStillZombieChannel takes the timestamps of the latest channel
|
||||
// updates for a channel and returns true if the channel should be
|
||||
// considered a zombie based on these timestamps.
|
||||
IsStillZombieChannel func(time.Time, time.Time) bool
|
||||
}
|
||||
|
||||
// SyncManager is a subsystem of the gossiper that manages the gossip syncers
|
||||
@@ -501,6 +506,7 @@ func (m *SyncManager) createGossipSyncer(peer lnpeer.Peer) *GossipSyncer {
|
||||
markGraphSynced: m.markGraphSynced,
|
||||
maxQueryChanRangeReplies: maxQueryChanRangeReplies,
|
||||
noTimestampQueryOption: m.cfg.NoTimestampQueries,
|
||||
isStillZombieChannel: m.cfg.IsStillZombieChannel,
|
||||
})
|
||||
|
||||
// Gossip syncers are initialized by default in a PassiveSync type
|
||||
|
||||
@@ -293,6 +293,11 @@ type gossipSyncerCfg struct {
|
||||
// maxQueryChanRangeReplies is the maximum number of replies we'll allow
|
||||
// for a single QueryChannelRange request.
|
||||
maxQueryChanRangeReplies uint32
|
||||
|
||||
// isStillZombieChannel takes the timestamps of the latest channel
|
||||
// updates for a channel and returns true if the channel should be
|
||||
// considered a zombie based on these timestamps.
|
||||
isStillZombieChannel func(time.Time, time.Time) bool
|
||||
}
|
||||
|
||||
// GossipSyncer is a struct that handles synchronizing the channel graph state
|
||||
|
||||
Reference in New Issue
Block a user