diff --git a/node.py b/node.py index 8a18b2c..2df707d 100644 --- a/node.py +++ b/node.py @@ -790,6 +790,10 @@ def handle(self): send(self.request, "blocknfhb") # announce we are on hyperblocks send(self.request, data) + if node.peers.warning(self.request, peer_ip, "Forked", 2): + node.logger.app_log.info(f"{peer_ip} banned") + break + else: node.logger.app_log.info(f"Inbound: Client is at block {client_block}") # now check if we have any newer diff --git a/worker.py b/worker.py index 7bb1b59..0386432 100644 --- a/worker.py +++ b/worker.py @@ -167,6 +167,9 @@ def worker(host, port, node): send(s, "blocknfhb") send(s, data) + if node.peers.warning(s, peer_ip, "Forked", 1): + raise ValueError(f"{peer_ip} is banned") + else: node.logger.app_log.warning( f"Outbound: Node is at block {client_block}") # now check if we have any newer