discovery: increase allowed max future message size

This commit adds a new const to increase the max future messages allowed
from 100 to 1000, which is needed as during IBD a node with lots of
channels might receive many future messages.
This commit is contained in:
yyforyongyu
2023-02-24 04:23:41 +08:00
parent 251802d796
commit a6abb3c960

View File

@@ -47,6 +47,10 @@ const (
// updates that we'll hold onto.
maxPrematureUpdates = 100
// maxFutureMessages tracks the max amount of future messages that
// we'll hold onto.
maxFutureMessages = 1000
// DefaultSubBatchDelay is the default delay we'll use when
// broadcasting the next announcement batch.
DefaultSubBatchDelay = 5 * time.Second
@@ -483,7 +487,7 @@ func New(cfg Config, selfKeyDesc *keychain.KeyDescriptor) *AuthenticatedGossiper
cfg: &cfg,
networkMsgs: make(chan *networkMsg),
futureMsgs: lru.NewCache[uint32, *cachedNetworkMsg](
maxPrematureUpdates,
maxFutureMessages,
),
quit: make(chan struct{}),
chanPolicyUpdates: make(chan *chanPolicyUpdateRequest),