@peer_required
@api_request
async def register_interest_in_puzzle_hash(self, request: wallet_protocol.RegisterForPhUpdates, peer: ws.WSChiaConnection):
    if (peer.peer_node_id not in self.full_node.peer_puzzle_hash):
        self.full_node.peer_puzzle_hash[peer.peer_node_id] = set()
    if (peer.peer_node_id not in self.full_node.peer_sub_counter):
        self.full_node.peer_sub_counter[peer.peer_node_id] = 0
    hint_coin_ids = []
    max_items = self.full_node.config.get('max_subscribe_items', 200000)
    for puzzle_hash in request.puzzle_hashes:
        ph_hint_coins = (await self.full_node.hint_store.get_coin_ids(puzzle_hash))
        hint_coin_ids.extend(ph_hint_coins)
        if (puzzle_hash not in self.full_node.ph_subscriptions):
            self.full_node.ph_subscriptions[puzzle_hash] = set()
        if ((peer.peer_node_id not in self.full_node.ph_subscriptions[puzzle_hash]) and (self.full_node.peer_sub_counter[peer.peer_node_id] < max_items)):
            self.full_node.ph_subscriptions[puzzle_hash].add(peer.peer_node_id)
            self.full_node.peer_puzzle_hash[peer.peer_node_id].add(puzzle_hash)
            self.full_node.peer_sub_counter[peer.peer_node_id] += 1
    states: List[CoinState] = (await self.full_node.coin_store.get_coin_states_by_puzzle_hashes(include_spent_coins=True, puzzle_hashes=request.puzzle_hashes, min_height=request.min_height))
    if (len(hint_coin_ids) > 0):
        hint_states = (await self.full_node.coin_store.get_coin_states_by_ids(include_spent_coins=True, coin_ids=hint_coin_ids, min_height=request.min_height))
        states.extend(hint_states)
    response = wallet_protocol.RespondToPhUpdates(request.puzzle_hashes, request.min_height, states)
    msg = make_msg(ProtocolMessageTypes.respond_to_ph_update, response)
    return msg
@peer_required
@api_request
async def register_interest_in_puzzle_hash(self, request: wallet_protocol.RegisterForPhUpdates, peer: ws.WSChiaConnection):
    if (peer.peer_node_id not in self.full_node.peer_puzzle_hash):
        self.full_node.peer_puzzle_hash[peer.peer_node_id] = set()
    if (peer.peer_node_id not in self.full_node.peer_sub_counter):
        self.full_node.peer_sub_counter[peer.peer_node_id] = 0
    hint_coin_ids = []
    max_items = self.full_node.config.get('max_subscribe_items', 200000)
    for puzzle_hash in request.puzzle_hashes:
        ph_hint_coins = (await self.full_node.hint_store.get_coin_ids(puzzle_hash))
        hint_coin_ids.extend(ph_hint_coins)
        if (puzzle_hash not in self.full_node.ph_subscriptions):
            self.full_node.ph_subscriptions[puzzle_hash] = set()
        if ((peer.peer_node_id not in self.full_node.ph_subscriptions[puzzle_hash]) and (self.full_node.peer_sub_counter[peer.peer_node_id] < max_items)):
            self.full_node.ph_subscriptions[puzzle_hash].add(peer.peer_node_id)
            self.full_node.peer_puzzle_hash[peer.peer_node_id].add(puzzle_hash)
            self.full_node.peer_sub_counter[peer.peer_node_id] += 1
    states: List[CoinState] = (await self.full_node.coin_store.get_coin_states_by_puzzle_hashes(include_spent_coins=True, puzzle_hashes=request.puzzle_hashes, min_height=request.min_height))
    if (len(hint_coin_ids) > 0):
        hint_states = (await self.full_node.coin_store.get_coin_states_by_ids(include_spent_coins=True, coin_ids=hint_coin_ids, min_height=request.min_height))
        states.extend(hint_states)
    response = wallet_protocol.RespondToPhUpdates(request.puzzle_hashes, request.min_height, states)
    msg = make_msg(ProtocolMessageTypes.respond_to_ph_update, response)
    return msg