diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-02-24 22:11:12 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-02-24 22:11:12 +0000 |
commit | ee8dce3084261447420f0bb7abeb6807583325ee (patch) | |
tree | cd748ccd045e59271de63bb30193c2a052f7971a /src/or/router.c | |
parent | b8f1092077159d71734404522add4488a882eac4 (diff) | |
download | tor-ee8dce3084261447420f0bb7abeb6807583325ee.tar.gz tor-ee8dce3084261447420f0bb7abeb6807583325ee.zip |
r14421@tombo: nickm | 2008-02-24 17:05:18 -0500
Patch from mwenge: always willingly serve our own extrainfo from the controlport
svn:r13699
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c index 2a2493998d..9b22d86ed1 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -1094,6 +1094,19 @@ router_digest_is_me(const char *digest) return identitykey && !memcmp(identitykey_digest, digest, DIGEST_LEN); } +/** Return true iff I'm a server and <b>digest</b> is equal to + * my identity digest. */ +int +router_extrainfo_digest_is_me(const char *digest) +{ + if (!router_get_my_extrainfo()) + return 0; + + return !memcmp(digest, + &(router_get_my_extrainfo()->cache_info).signed_descriptor_digest, + DIGEST_LEN); +} + /** A wrapper around router_digest_is_me(). */ int router_is_me(routerinfo_t *router) |