]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't send padding bytes for pings 2020-01-bitcoinrpc-dep-head
authorMatt Corallo <git@bluematt.me>
Sat, 15 Feb 2020 03:51:09 +0000 (22:51 -0500)
committerMatt Corallo <git@bluematt.me>
Tue, 5 May 2020 21:27:02 +0000 (17:27 -0400)
We (somewhat needlessly) send an extra 64 bytes with every ping.
While this isn't exactly a big deal, I saw it and figured we
shouldn't waste bytes on the wire given some of the constraints of
potential users.

lightning/src/ln/peer_handler.rs

index aa6954407302b966f8cea43c37d14b41f52b4628..b4e3e533ee885dc6ceccbd502c29f3539f30b0a9 100644 (file)
@@ -1181,7 +1181,7 @@ impl<Descriptor: SocketDescriptor, CM: Deref> PeerManager<Descriptor, CM> where
 
                                let ping = msgs::Ping {
                                        ponglen: 0,
-                                       byteslen: 64,
+                                       byteslen: 0,
                                };
                                peer.pending_outbound_buffer.push_back(peer.channel_encryptor.encrypt_message(&encode_msg!(&ping)));