Add a comment about bto_update_best.

This commit is contained in:
Taylor Yu 2018-12-21 11:38:58 -06:00 committed by Nick Mathewson
parent b0ae6a332a
commit 9d29abb34e

View File

@ -62,6 +62,9 @@ bto_update_best(const bt_orconn_t *bto, bto_best_t *best, const char *type)
{ {
if (bto->state < best->state) if (bto->state < best->state)
return false; return false;
/* Update even if we won't change best->state, because it's more
* recent information that a particular connection transitioned to
* that state. */
best->gid = bto->gid; best->gid = bto->gid;
if (bto->state > best->state) { if (bto->state > best->state) {
log_info(LD_BTRACK, "ORCONN BEST_%s state %d->%d gid=%"PRIu64, type, log_info(LD_BTRACK, "ORCONN BEST_%s state %d->%d gid=%"PRIu64, type,