diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-03-27 18:25:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-03-27 18:25:41 -0400 |
commit | ddee28a3c9b9dd256cd6560a4766f17a6c6fc13d (patch) | |
tree | f47c5bd619ee004642e7332f4eec6f4b3979b45b /src/or | |
parent | da5173c83148b4b437488571c2f6e88dc2e175eb (diff) | |
parent | 471f28a2a85b8db8315f518aff456440f9791877 (diff) | |
download | tor-ddee28a3c9b9dd256cd6560a4766f17a6c6fc13d.tar.gz tor-ddee28a3c9b9dd256cd6560a4766f17a6c6fc13d.zip |
Merge remote-tracking branch 'catalyst-github/bug25629-033' into maint-0.3.3
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/nodelist.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 391b31d683..125dd8b9f1 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -507,22 +507,22 @@ nodelist_add_microdesc(microdesc_t *md) if (rs == NULL) return NULL; node = node_get_mutable_by_id(rs->identity_digest); - if (node) { - node_remove_from_ed25519_map(node); - if (node->md) - node->md->held_by_nodes--; + if (node == NULL) + return NULL; - node->md = md; - md->held_by_nodes++; - /* Setting the HSDir index requires the ed25519 identity key which can - * only be found either in the ri or md. This is why this is called here. - * Only nodes supporting HSDir=2 protocol version needs this index. */ - if (rs->pv.supports_v3_hsdir) { - node_set_hsdir_index(node, ns); - } - node_add_to_ed25519_map(node); - } + node_remove_from_ed25519_map(node); + if (node->md) + node->md->held_by_nodes--; + node->md = md; + md->held_by_nodes++; + /* Setting the HSDir index requires the ed25519 identity key which can + * only be found either in the ri or md. This is why this is called here. + * Only nodes supporting HSDir=2 protocol version needs this index. */ + if (rs->pv.supports_v3_hsdir) { + node_set_hsdir_index(node, ns); + } + node_add_to_ed25519_map(node); node_add_to_address_set(node); return node; |