code: func (h *Handler) HandleQueryStateClose(msg *pb.ChaincodeMessage, txContext *TransactionContext) (*pb.ChaincodeMessage, error) {
  	queryStateClose := &pb.QueryStateClose{}
  	err := proto.Unmarshal(msg.Payload, queryStateClose)
  	if err != nil {
  		return nil, errors.Wrap(err, "unmarshal failed")
  	}
  
  	iter := txContext.GetQueryIterator(queryStateClose.Id)
  	if iter != nil {
  		txContext.CleanupQueryContext(queryStateClose.Id)
  	}
  
  	payload := &pb.QueryResponse{HasMore: false, Id: queryStateClose.Id}
  	payloadBytes, err := proto.Marshal(payload)
  	if err != nil {
  		return nil, errors.Wrap(err, "marshal failed")
  	}
  
  	return &pb.ChaincodeMessage{Type: pb.ChaincodeMessage_RESPONSE, Payload: payloadBytes, Txid: msg.Txid, ChannelId: msg.ChannelId}, nil
  }
docs: // Handles the closing of a state iterator