Skip to content

Commit

Permalink
Fixed dht_pkt_alert processing
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman committed Jun 11, 2020
1 parent b4e7141 commit 3f54b1d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -363,11 +363,11 @@ def process_alert(self, alert, hops=0):
elif alert_type == "dht_pkt_alert":
# We received a raw DHT message - decode it and check whether it is a BEP33 message.
decoded = bdecode_compat(alert.pkt_buf)
if decoded and 'r' in decoded:
if 'BFsd' in decoded['r'] and 'BFpe' in decoded['r']:
self.dht_health_manager.received_bloomfilters(decoded['r']['id'],
bytearray(decoded['r']['BFsd']),
bytearray(decoded['r']['BFpe']))
if decoded and b'r' in decoded:
if b'BFsd' in decoded[b'r'] and b'BFpe' in decoded[b'r']:
self.dht_health_manager.received_bloomfilters(decoded[b'r'][b'id'],
bytearray(decoded[b'r'][b'BFsd']),
bytearray(decoded[b'r'][b'BFpe']))

def update_ip_filter(self, lt_session, ip_addresses):
self._logger.debug('Updating IP filter %s', ip_addresses)
Expand Down

0 comments on commit 3f54b1d

Please sign in to comment.