Skip to content

Commit

Permalink
only print warnings about protocol mismatches for farmer and harvester (
Browse files Browse the repository at this point in the history
#17801)

only print warnings about protocol mismatches for farmer and harvester. In the future, maybe this should also include trusted wallets
  • Loading branch information
arvidn authored Mar 29, 2024
1 parent ec258d0 commit 23288e7
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions chia/server/ws_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,9 +221,13 @@ async def perform_handshake(
if inbound_handshake.network_id != network_id:
raise ProtocolError(Err.INCOMPATIBLE_NETWORK_ID)

if inbound_handshake.protocol_version != protocol_version[local_type]:
if (
local_type in [NodeType.FARMER, NodeType.HARVESTER]
and inbound_handshake.protocol_version != protocol_version[local_type]
):
self.log.warning(
f"protocol version mismatch: "
f"local_type={local_type} "
f"incoming={inbound_handshake.protocol_version} "
f"our={protocol_version[local_type]}"
)
Expand Down Expand Up @@ -258,9 +262,15 @@ async def perform_handshake(

remote_node_type = NodeType(inbound_handshake.node_type)

if inbound_handshake.protocol_version != protocol_version[remote_node_type]:
if (
remote_node_type in [NodeType.FARMER, NodeType.HARVESTER]
and inbound_handshake.protocol_version != protocol_version[remote_node_type]
):
self.log.warning(
f"protocol version mismatch: incoming={inbound_handshake.protocol_version} our={protocol_version}"
f"protocol version mismatch: "
f"remote_type={remote_node_type} "
f"incoming={inbound_handshake.protocol_version} "
f"our={protocol_version[remote_node_type]}"
)

outbound_handshake = make_msg(
Expand Down

0 comments on commit 23288e7

Please sign in to comment.