def METHOD_NAME(self, peer_id: bytes32, coin_ids: List[bytes32], max_items: int) -> None:
    coin_id_peers = self._peer_coin_ids.setdefault(peer_id, set())
    existing_sub_count = self._peer_sub_counter.setdefault(peer_id, 0)
    # if we've reached the limit on number of subscriptions, just bail
    if existing_sub_count >= max_items:
        log.info(
            "peer_id: %s reached max number of coin subscriptions. Not all its coin states will be reported",
            peer_id,
        )
        return
    # decrement this counter as we go, to know if we've hit the limit of
    # number of subscriptions
    subscriptions_left = max_items - existing_sub_count
    for coin_id in coin_ids:
        coin_sub = self._coin_subscriptions.setdefault(coin_id, set())
        if peer_id in coin_sub:
            continue
        coin_sub.add(peer_id)
        coin_id_peers.add(coin_id)
        self._peer_sub_counter[peer_id] += 1
        subscriptions_left -= 1
        if subscriptions_left == 0:
            log.info(
                "peer_id: %s reached max number of coin subscriptions. Not all its coin states will be reported",
                peer_id,
            )
            break