def METHOD_NAME(event, inbound):
    nonlocal checked_inbound_version_msg, checked_outbound_version_msg
    if event.msg_type.decode("utf-8") == "version":
        self.log.info(
            f"check_p2p_message(): {'inbound' if inbound else 'outbound'} {event}")
        peer = self.nodes[0].getpeerinfo()[0]
        msg = msg_version()
        msg.deserialize(BytesIO(bytes(event.msg[:event.msg_size])))
        assert_equal(peer["id"], event.peer_id, peer["id"])
        assert_equal(peer["addr"], event.peer_addr.decode("utf-8"))
        assert_equal(peer["connection_type"],
                     event.peer_conn_type.decode("utf-8"))
        if inbound:
            checked_inbound_version_msg += 1
        else:
            checked_outbound_version_msg += 1