}
/** <b>node</b> is an HSDir so make sure that we have assigned an hsdir index.
+ * If <b>is_for_next_period</b> is set, also check the next HSDir index field.
* Return 0 if everything is as expected, else return -1. */
static int
-node_has_hsdir_index(const node_t *node)
+node_has_hsdir_index(const node_t *node, int is_for_next_period)
{
tor_assert(node_supports_v3_hsdir(node));
return 0;
}
+ if (is_for_next_period &&
+ BUG(tor_mem_is_zero((const char*)node->hsdir_index->next,
+ DIGEST256_LEN))) {
+ return 0;
+ }
+
return 1;
}
node_t *n = node_get_mutable_by_id(rs->identity_digest);
tor_assert(n);
if (node_supports_v3_hsdir(n) && rs->is_hs_dir) {
- if (!node_has_hsdir_index(n)) {
+ if (!node_has_hsdir_index(n, is_next_period)) {
log_info(LD_GENERAL, "Node %s was found without hsdir index.",
node_describe(n));
continue;