From: Valentine Wallace Date: Thu, 25 Aug 2022 17:56:19 +0000 (-0400) Subject: PeerMan: fix bug in drop_gossip util X-Git-Tag: v0.0.111~24^2~2 X-Git-Url: http://git.bitcoin.ninja/?a=commitdiff_plain;h=1de698fdd9274dc47e18fb680ea15166742785a1;p=rust-lightning PeerMan: fix bug in drop_gossip util Fixes a flipped bool that was introduced in 4a1ee5f9a984c9b0c0892025d624ade734337b1a --- diff --git a/lightning/src/ln/peer_handler.rs b/lightning/src/ln/peer_handler.rs index 623aa969d..925d7e594 100644 --- a/lightning/src/ln/peer_handler.rs +++ b/lightning/src/ln/peer_handler.rs @@ -399,11 +399,8 @@ impl Peer { /// Returns whether this peer's buffer is full and we should drop gossip messages. fn buffer_full_drop_gossip(&self) -> bool { - if self.pending_outbound_buffer.len() > OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP - || self.msgs_sent_since_pong > BUFFER_DRAIN_MSGS_PER_TICK * FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO { - return false - } - true + self.pending_outbound_buffer.len() > OUTBOUND_BUFFER_LIMIT_DROP_GOSSIP || + self.msgs_sent_since_pong > BUFFER_DRAIN_MSGS_PER_TICK * FORWARD_INIT_SYNC_BUFFER_LIMIT_RATIO } }