Skip to content

Commit 32bb408

Browse files
committed
PR feedback
1 parent 3da5501 commit 32bb408

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

p2p/peer.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -849,10 +849,6 @@ async def start_peer(self, peer: BasePeer) -> None:
849849
self.logger.debug("DAO fork check with %s failed: %s", peer, err)
850850
await peer.disconnect(DisconnectReason.useless_peer)
851851
return
852-
except MalformedMessage as err:
853-
self.logger.debug("DAO fork check with %s failed: %s", peer, err)
854-
await peer.disconnect(DisconnectReason.bad_protocol)
855-
return
856852
asyncio.ensure_future(peer.run(finished_callback=self._peer_finished))
857853
self._add_peer(peer, msgs)
858854

@@ -977,6 +973,12 @@ async def ensure_same_side_on_dao_fork(
977973
except (TimeoutError, PeerConnectionLost) as err:
978974
raise DAOForkCheckFailure(
979975
"Timed out waiting for DAO fork header from {}: {}".format(peer, err))
976+
except MalformedMessage as err:
977+
raise DAOForkCheckFailure(
978+
"Malformed message while doing DAO fork check with {0}: {1}".format(
979+
peer, err,
980+
)
981+
) from err
980982

981983
try:
982984
request.validate_headers(headers)

0 commit comments

Comments
 (0)