Refactor rend_cache_lookup_entry()
Here is why rend_cache_lookup_entry()
should be refactored:
-
v0 descriptors are deprecated since 0.2.2.1 and not suppose to be alive in the network anymore. This function should only serve v2 version for now as the default.
-
It should return different error code depending on what's the actual error is. Right now, there is no distinction between a cache entry not found and an invalid query.
-
This function should NOT test if the intro points are usable or not. This adds some load on a function that should be "O(1)" and do one job. Furthermore, multiple callsites actually already test that doing twice the job...
-
While adding control event, it would be useful to be able to lookup a cache entry without having it checking the intro points. There are also places in the code that do want to lookup the cache entry without doing that.