]> git.bitcoin.ninja Git - rust-lightning/commitdiff
PeerMan: fix bug in drop_gossip util
authorValentine Wallace <vwallace@protonmail.com>
Thu, 25 Aug 2022 17:56:19 +0000 (13:56 -0400)
committerValentine Wallace <vwallace@protonmail.com>
Thu, 25 Aug 2022 18:56:50 +0000 (14:56 -0400)
Fixes a flipped bool that was introduced in
4a1ee5f9a984c9b0c0892025d624ade734337b1a

lightning/src/ln/peer_handler.rs

index 623aa969dfd4262da60773428c6d03aff681a4ab..925d7e5946d82f4e5e5fd463c9ac7cd27f366925 100644 (file)
@@ -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
        }
 }