@@ -258,8 +258,18 @@ friend class CAddrManTest;
258
258
// ! Select several addresses at once.
259
259
void GetAddr_ (std::vector<CAddress> &vAddr, size_t max_addresses, size_t max_pct) EXCLUSIVE_LOCKS_REQUIRED(cs);
260
260
261
- // ! Mark an entry as currently-connected-to.
262
- void Connected_ (const CService &addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
261
+ /* * We have successfully connected to this peer. Calling this function
262
+ * updates the CAddress's nTime, which is used in our IsTerrible()
263
+ * decisions and gossiped to peers. Callers should be careful that updating
264
+ * this information doesn't leak topology information to network spies.
265
+ *
266
+ * net_processing calls this function when it *disconnects* from a peer to
267
+ * not leak information about currently connected peers.
268
+ *
269
+ * @param[in] addr The address of the peer we were connected to
270
+ * @param[in] nTime The time that we were last connected to this peer
271
+ */
272
+ void Connected_ (const CService& addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
263
273
264
274
// ! Update an entry's service bits.
265
275
void SetServices_ (const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
@@ -676,7 +686,7 @@ friend class CAddrManTest;
676
686
return vAddr;
677
687
}
678
688
679
- // ! Mark an entry as currently-connected-to.
689
+ // ! Outer function for Connected_()
680
690
void Connected (const CService &addr, int64_t nTime = GetAdjustedTime())
681
691
{
682
692
LOCK (cs);
0 commit comments