Don't send inv msg when empty (#909)

This commit is contained in:
Jonathan Zernik 2021-08-11 14:20:10 -07:00 committed by GitHub
parent e127297f16
commit afa8ccd144
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,8 +165,9 @@ class PeerMessageHandler:
invs = [
CInv(type=1, hash=squeak_hash)
for squeak_hash in squeak_hashes]
inv_msg = msg_inv(inv=invs)
self.peer.send_msg(inv_msg)
if invs:
inv_msg = msg_inv(inv=invs)
self.peer.send_msg(inv_msg)
def handle_squeak(self, msg):
squeak = msg.squeak