From b5341314c17573db15a7cc5999f36569c764c462 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 30 Sep 2010 18:37:53 -0400 Subject: Implement a few more node-based functions Some of these functions only work for routerinfo-based nodes, and as such are only usable for advisory purposes. Fortunately, our uses of them are compatible with this limitation. --- src/or/rephist.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/or/rephist.c') diff --git a/src/or/rephist.c b/src/or/rephist.c index 97a3c54546..1b978d963d 100644 --- a/src/or/rephist.c +++ b/src/or/rephist.c @@ -881,8 +881,12 @@ rep_hist_get_router_stability_doc(time_t now) if (node) { char ip[INET_NTOA_BUF_LEN+1]; char tbuf[ISO_TIME_LEN+1]; + time_t published = node_get_published_on(node); node_get_address_string(node,ip,sizeof(ip)); - format_iso_time(tbuf, node_get_published_on(node)); + if (published > 0) + format_iso_time(tbuf, published); + else + strlcpy(tbuf, "???", sizeof(tbuf)); tor_snprintf(header_buf, sizeof(header_buf), "router %s %s %s\n" "published %s\n" -- cgit v1.2.3-54-g00ecf