aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.h
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2020-11-04 11:41:17 +0000
committerJohn Newbery <john@johnnewbery.com>2020-11-04 11:41:17 +0000
commit0bfce9dc46234b196a8b3679c21d6f8455962495 (patch)
tree50518982ad7ed2b60d27add1dd92b62db54d4eea /src/addrman.h
parenteefe19471868ef0cdc9d32473d0b57015e7647ee (diff)
downloadbitcoin-0bfce9dc46234b196a8b3679c21d6f8455962495.tar.xz
[addrman] Fix Connected() comment
Diffstat (limited to 'src/addrman.h')
-rw-r--r--src/addrman.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/addrman.h b/src/addrman.h
index b4089dc894..8b6c05e7ee 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -258,8 +258,18 @@ protected:
//! Select several addresses at once.
void GetAddr_(std::vector<CAddress> &vAddr, size_t max_addresses, size_t max_pct) EXCLUSIVE_LOCKS_REQUIRED(cs);
- //! Mark an entry as currently-connected-to.
- void Connected_(const CService &addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
+ /** We have successfully connected to this peer. Calling this function
+ * updates the CAddress's nTime, which is used in our IsTerrible()
+ * decisions and gossiped to peers. Callers should be careful that updating
+ * this information doesn't leak topology information to network spies.
+ *
+ * net_processing calls this function when it *disconnects* from a peer to
+ * not leak information about currently connected peers.
+ *
+ * @param[in] addr The address of the peer we were connected to
+ * @param[in] nTime The time that we were last connected to this peer
+ */
+ void Connected_(const CService& addr, int64_t nTime) EXCLUSIVE_LOCKS_REQUIRED(cs);
//! Update an entry's service bits.
void SetServices_(const CService &addr, ServiceFlags nServices) EXCLUSIVE_LOCKS_REQUIRED(cs);
@@ -676,7 +686,7 @@ public:
return vAddr;
}
- //! Mark an entry as currently-connected-to.
+ //! Outer function for Connected_()
void Connected(const CService &addr, int64_t nTime = GetAdjustedTime())
{
LOCK(cs);