@@ -398,12 +398,9 @@ impl Peer {
398
398
}
399
399
400
400
/// Returns whether this peer's buffer is full and we should drop gossip messages.
401
- fn buffer_full_drop_gossip ( & self ) -> bool {
402
- if self . pending_outbound_buffer . len ( ) > OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP
403
- || self . msgs_sent_since_pong > BUFFER_DRAIN_MSGS_PER_TICK * FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO {
404
- return false
405
- }
406
- true
401
+ fn buffer_full_drop_gossip_broadcast ( & self ) -> bool {
402
+ self . pending_outbound_buffer . len ( ) > OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP ||
403
+ self . msgs_sent_since_pong > BUFFER_DRAIN_MSGS_PER_TICK * FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO
407
404
}
408
405
}
409
406
@@ -1325,7 +1322,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
1325
1322
!peer. should_forward_channel_announcement ( msg. contents . short_channel_id ) {
1326
1323
continue
1327
1324
}
1328
- if peer. buffer_full_drop_gossip ( ) {
1325
+ if peer. buffer_full_drop_gossip_broadcast ( ) {
1329
1326
log_gossip ! ( self . logger, "Skipping broadcast message to {:?} as its outbound buffer is full" , peer. their_node_id) ;
1330
1327
continue ;
1331
1328
}
@@ -1349,7 +1346,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
1349
1346
!peer. should_forward_node_announcement ( msg. contents . node_id ) {
1350
1347
continue
1351
1348
}
1352
- if peer. buffer_full_drop_gossip ( ) {
1349
+ if peer. buffer_full_drop_gossip_broadcast ( ) {
1353
1350
log_gossip ! ( self . logger, "Skipping broadcast message to {:?} as its outbound buffer is full" , peer. their_node_id) ;
1354
1351
continue ;
1355
1352
}
@@ -1372,7 +1369,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref, RM: Deref, L: Deref, CMH: Deref> P
1372
1369
!peer. should_forward_channel_announcement ( msg. contents . short_channel_id ) {
1373
1370
continue
1374
1371
}
1375
- if peer. buffer_full_drop_gossip ( ) {
1372
+ if peer. buffer_full_drop_gossip_broadcast ( ) {
1376
1373
log_gossip ! ( self . logger, "Skipping broadcast message to {:?} as its outbound buffer is full" , peer. their_node_id) ;
1377
1374
continue ;
1378
1375
}
0 commit comments