]> git.bitcoin.ninja Git - rust-lightning/commitdiff
Don't send padding bytes for pings 2020-02-bitcoinrpc-dep-head-test
authorMatt Corallo <git@bluematt.me>
Sat, 15 Feb 2020 03:51:09 +0000 (22:51 -0500)
committerMatt Corallo <git@bluematt.me>
Sun, 1 Mar 2020 04:26:16 +0000 (23:26 -0500)
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 f5eda9e66160332e246f5fed39653878432e8b46..9e53cb1358946ce0d4a12c8338dc32c1aa98cd0f 100644 (file)
@@ -1180,7 +1180,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)));