Browse Source

network: disconnect from server on malformed header subs

closes #4478
3.2.x
SomberNight 7 years ago
parent
commit
75a85a8161
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      lib/network.py

5
lib/network.py

@ -1065,7 +1065,12 @@ class Network(util.DaemonThread):
self.on_stop() self.on_stop()
def on_notify_header(self, interface, header_dict): def on_notify_header(self, interface, header_dict):
try:
header_hex, height = header_dict['hex'], header_dict['height'] header_hex, height = header_dict['hex'], header_dict['height']
except KeyError:
# no point in keeping this connection without headers sub
self.connection_down(interface.server)
return
header = blockchain.deserialize_header(util.bfh(header_hex), height) header = blockchain.deserialize_header(util.bfh(header_hex), height)
if height < self.max_checkpoint(): if height < self.max_checkpoint():
self.connection_down(interface.server) self.connection_down(interface.server)

Loading…
Cancel
Save