Skip to content

Commit 0bfce9d

Browse files
committed
[addrman] Fix Connected() comment
1 parent eefe194 commit 0bfce9d

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/addrman.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,18 @@ friend class CAddrManTest;
258258
//! Select several addresses at once.
259259
void GetAddr_(std::vector<CAddress> &vAddr, size_t max_addresses, size_t max_pct) EXCLUSIVE_LOCKS_REQUIRED(cs);
260260

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);
263273

264274
//! Update an entry's service bits.
265275
void SetServices_(const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
@@ -676,7 +686,7 @@ friend class CAddrManTest;
676686
return vAddr;
677687
}
678688

679-
//! Mark an entry as currently-connected-to.
689+
//! Outer function for Connected_()
680690
void Connected(const CService &addr, int64_t nTime = GetAdjustedTime())
681691
{
682692
LOCK(cs);

0 commit comments

Comments
 (0)