mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 06:28:31 +01:00
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).
This commit is contained in:
@@ -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);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user