浏览代码

Improve log when unable to add sigs to pending consensus

Closes ticket 24849.
Nick Mathewson 6 年之前
父节点
当前提交
75d4bd3497
共有 2 个文件被更改,包括 10 次插入1 次删除
  1. 3 0
      changes/ticket24849
  2. 7 1
      src/or/dirvote.c

+ 3 - 0
changes/ticket24849

@@ -0,0 +1,3 @@
+  o Minor features (directory authority):
+    - When unable to add signatures to a pending consensus, log the reason
+      why. Closes ticket 24849.

+ 7 - 1
src/or/dirvote.c

@@ -3551,7 +3551,13 @@ dirvote_add_signatures_to_pending_consensus(
   }
   r = networkstatus_add_detached_signatures(pc->consensus, sigs,
                                             source, severity, msg_out);
-  log_info(LD_DIR,"Added %d signatures to consensus.", r);
+  if (r >= 0) {
+    log_info(LD_DIR,"Added %d signatures to consensus.", r);
+  } else {
+    log_fn(LOG_PROTOCOL_WARN, LD_DIR,
+           "Unable to add signatures to consensus: %s",
+           *msg_out ? *msg_out : "(unknown)");
+  }
 
   if (r >= 1) {
     char *new_signatures =