<p>From the <a href="https://en.bitcoin.it/wiki/Protocol_documentation#getaddr" rel="nofollow noreferrer">Bitcoin wiki</a>:</p>
<blockquote>
<p>The <code>getaddr</code> message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.</p>
</blockquote>
<p>In the Bitcoin Core implementation <code>AddrMan</code> (Address Manager, <a href="https://github.com/bitcoin/bitcoin/blob/master/src/addrman.cpp" rel="nofollow noreferrer">.cpp file</a>) manages a node's known addresses. As the correction below in the comments says the response to a <code>getaddr</code> request will return <strong>both</strong> tried and untried (new) addresses.</p>

CC BY-SA 4.0
2022-08-30T11:25:45.847Z
That's incorrect. Both tried and new addresses are sent (though as the other answer points out, this is implementation specific - the protocol has no notion of tried and new addresses).
Pieter Wuille
CC BY-SA 4.0
2022-08-30T11:33:55.567Z
I would have also thought superior logic would be to send tried addresses because your peer will disconnect from you if you send a bunch of untried addresses that turn out to be unresponsive. I guess it is a privacy, maintaining connections trade-off
Michael Folkson
CC BY-SA 4.0
2022-08-30T12:13:37.780Z
No, we don't disconnect peers that give us unresponsible IP addresses.
Pieter Wuille
CC BY-SA 4.0
2022-08-30T11:16:12.670Z
2022-08-30T11:51:33.587Z
2022-08-30T11:51:33.587Z
Michael Folkson
<blockquote>
<p>What is the frequency of the addr messages in bitcoin?</p>
</blockquote>
<p>I believe they are sent in response to a <code>getaddr</code> message. So the frequency at which your node receives <code>addr</code> messages depends on the frequency your node issues <code>getaddr</code> messages.</p>
<blockquote>
<p>are the contents of the addr messages from the new or the tried table or both?</p>
</blockquote>
<p>The network protocol specification doesn't specify the source in that way. It says</p>
<p><strong><a href="https://en.bitcoin.it/wiki/Protocol_documentation#getaddr" rel="nofollow noreferrer">getaddr</a></strong></p>
<blockquote>
<p>The getaddr message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.</p>
</blockquote>
<p><strong><a href="https://en.bitcoin.it/wiki/Protocol_documentation#addr" rel="nofollow noreferrer">addr</a></strong>:</p>
<blockquote>
<p>Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours</p>
</blockquote>
<p>To me this suggests each implementer chooses exactly how to source, categorise, store and maintain the data it uses in the response. If in doubt the implementer presumably consults the source code of whatever implementation they regard as the reference implementation.</p>
<p>I guess it would be prudent not to make any assumptions about the sending node's selection of entries in it's <code>addr</code> response. The sending node may be hostile or faulty.</p>

CC BY-SA 4.0
2022-08-30T12:44:49.997Z
I believe you mean getaddr? getdata based on my understanding is used for information regarding transactions
Vinay Shetty
CC BY-SA 4.0
2022-08-30T13:01:33.840Z
@Vinay: Thanks, I believe you are right. Answer updated accordingly.
RedGrittyBrick
CC BY-SA 4.0
2022-08-30T09:52:12.130Z
2022-08-30T12:59:21.367Z
2022-08-30T12:59:21.367Z
RedGrittyBrick
<p>What is the frequency of the addr messages in bitcoin?
And are the contents of the addr messages from the new or the tried table or both?</p>

<bitcoin-core><bitcoind><bitcoin-core-development><p2p>
Details regarding bitcoin addr messages
Vinay Shetty
# Details regarding bitcoin addr messages

(Asked by: username_0 on 2022-08-29)

What is the frequency of the addr messages in bitcoin?
And are the contents of the addr messages from the new or the tried table or both?

**Tags:** bitcoin-core, bitcoind, bitcoin-core-development, p2p


---

## 2 answers

### Answer by username_1 on 2022-08-30. Score: 1 | Accepted answer

From the [Bitcoin wiki](https://en.bitcoin.it/wiki/Protocol_documentation#getaddr):

> The `getaddr` message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.

In the Bitcoin Core implementation `AddrMan` (Address Manager, [.cpp file](https://github.com/bitcoin/bitcoin/blob/master/src/addrman.cpp)) manages a node's known addresses. As the correction below in the comments says the response to a `getaddr` request will return **both** tried and untried (new) addresses.

> **Comments:**
> **username_2**: That's incorrect. Both tried and new addresses are sent (though as the other answer points out, this is implementation specific - the protocol has no notion of tried and new addresses).  
> **username_1**: I would have also thought superior logic would be to send tried addresses because your peer will disconnect from you if you send a bunch of untried addresses that turn out to be unresponsive. I guess it is a privacy, maintaining connections trade-off  
> **username_2**: No, we don't disconnect peers that give us unresponsible IP addresses.  

---

### Answer by username_3 on 2022-08-30. Score: 2

> What is the frequency of the addr messages in bitcoin?

I believe they are sent in response to a `getaddr` message. So the frequency at which your node receives `addr` messages depends on the frequency your node issues `getaddr` messages.

> are the contents of the addr messages from the new or the tried table or both?

The network protocol specification doesn't specify the source in that way. It says

**[getaddr](https://en.bitcoin.it/wiki/Protocol_documentation#getaddr)**

> The getaddr message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.

**[addr](https://en.bitcoin.it/wiki/Protocol_documentation#addr)**:

> Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours

To me this suggests each implementer chooses exactly how to source, categorise, store and maintain the data it uses in the response. If in doubt the implementer presumably consults the source code of whatever implementation they regard as the reference implementation.

I guess it would be prudent not to make any assumptions about the sending node's selection of entries in it's `addr` response. The sending node may be hostile or faulty.

> **Comments:**
> **username_0**: I believe you mean getaddr? getdata based on my understanding is used for information regarding transactions  
> **username_3**: @username_0: Thanks, I believe you are right. Answer updated accordingly.  

---

