File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -285,14 +285,18 @@ enum InitSyncTracker{
285
285
NodesSyncing ( PublicKey ) ,
286
286
}
287
287
288
+ /// The ratio between buffer sizes at which we stop sending initial sync messages vs when we stop
289
+ /// forwarding gossip messages to peers altogether.
290
+ const FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO : usize = 2 ;
291
+
288
292
/// When the outbound buffer has this many messages, we'll stop reading bytes from the peer until
289
293
/// we have fewer than this many messages in the outbound buffer again.
290
294
/// We also use this as the target number of outbound gossip messages to keep in the write buffer,
291
295
/// refilled as we send bytes.
292
296
const OUTBOUND_BUFFER_LIMIT_READ_PAUSE : usize = 10 ;
293
297
/// When the outbound buffer has this many messages, we'll simply skip relaying gossip messages to
294
298
/// the peer.
295
- const OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP : usize = 20 ;
299
+ const OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP : usize = OUTBOUND_BUFFER_LIMIT_READ_PAUSE * FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO ;
296
300
297
301
struct Peer {
298
302
channel_encryptor : PeerChannelEncryptor ,
You can’t perform that action at this time.
0 commit comments