aboutsummaryrefslogtreecommitdiff
path: root/src/addrman.h
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2024-01-09 14:04:51 -0500
committerMartin Zumsande <mzumsande@gmail.com>2024-01-15 16:19:53 -0500
commit74ebd4d1359edce82a134dfcd3da9840f8d206e2 (patch)
treebbf47077cf910f1c7869a5e71c3e0f9c2c0d32b3 /src/addrman.h
parentb3b19be20deafef550e229355cf6008f55af7a11 (diff)
doc, test: Test and explain service flag handling
Service flags are handled differently, depending on whether validated (if received from the peer) or unvalidated (received via gossip relay).
Diffstat (limited to 'src/addrman.h')
-rw-r--r--src/addrman.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/addrman.h b/src/addrman.h
index ef9c766eff..be2ee8c2cb 100644
--- a/src/addrman.h
+++ b/src/addrman.h
@@ -111,13 +111,16 @@ public:
/**
* Attempt to add one or more addresses to addrman's new table.
+ * If an address already exists in addrman, the existing entry may be updated
+ * (e.g. adding additional service flags). If the existing entry is in the new table,
+ * it may be added to more buckets, improving the probability of selection.
*
* @param[in] vAddr Address records to attempt to add.
* @param[in] source The address of the node that sent us these addr records.
* @param[in] time_penalty A "time penalty" to apply to the address record's nTime. If a peer
* sends us an address record with nTime=n, then we'll add it to our
* addrman with nTime=(n - time_penalty).
- * @return true if at least one address is successfully added. */
+ * @return true if at least one address is successfully added, or added to an additional bucket. Unaffected by updates. */
bool Add(const std::vector<CAddress>& vAddr, const CNetAddr& source, std::chrono::seconds time_penalty = 0s);
/**