user124461: Suppose a node receives the same "inv" message from many peers.

Will the node send "getheaders" requests to all the peers or only one of them?

Does the node keep a timer for getting the "headers" response from the peers? How big
is the timer?

Suppose the node sends "getheaders" requests to only one of its peers and the timer expires. How many other peers does the node then send "getheaders" requests to? Does the node store a map data structure map<"inv", peer id from which the inv is received> to do this?



user208: 
During IBD, Bitcoin Core will only send getheaders to one peer. After IBD, it will send it to all on connection.
15 minutes. After that it will disconnect the peer if nothing is received.
As after timeout peers get disconnected, that opens up the slot for "headers requesting peer" to go to another one.


124461: <p>Suppose a node receives the same &quot;inv&quot; message from many peers.</p>
<ol>
<li><p>Will the node send &quot;getheaders&quot; requests to all the peers or only one of them?</p>
</li>
<li><p>Does the node keep a timer for getting the &quot;headers&quot; response from the peers? How big
is the timer?</p>
</li>
<li><p>Suppose the node sends &quot;getheaders&quot; requests to only one of its peers and the timer expires. How many other peers does the node then send &quot;getheaders&quot; requests to? Does the node store a map data structure <code>map&lt;&quot;inv&quot;, peer id from which the inv is received&gt;</code> to do this?</p>
</li>
</ol>
 208: <ol>
<li>During IBD, Bitcoin Core will only send getheaders to one peer. After IBD, it will send it to all on connection.</li>
<li>15 minutes. After that it will disconnect the peer if nothing is received.</li>
<li>As after timeout peers get disconnected, that opens up the slot for &quot;headers requesting peer&quot; to go to another one.</li>
</ol>
