Skip to content

Commit

Permalink
Properly handle peer dropping at bad time
Browse files Browse the repository at this point in the history
  • Loading branch information
EggPool committed Nov 29, 2019
1 parent dfb2932 commit 71e616d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions node.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# issues with db? perhaps you missed a commit() or two


VERSION = "4.4.0.8" # Post fork candidate 8
VERSION = "4.4.0.9" # Post fork candidate 9

import functools
import glob
Expand Down Expand Up @@ -776,7 +776,10 @@ def handle(self):

data = receive(self.request) # receive client's last block_hash
# send all our followup hashes

if data == "*":
# connection lost, no need to go on, that was banning the node like it forked.
node.logger.app_log.warning(f"Inbound: {peer_ip} dropped connection")
break
node.logger.app_log.info(f"Inbound: Will seek the following block: {data}")

client_block = db_handler_instance.block_height_from_hash(data)
Expand Down

0 comments on commit 71e616d

Please sign in to comment.