Merge pull request #233 from izderadicka/pex2

In PEX we should also look at dropped peers
This commit is contained in:
Igor Katson 2024-09-13 09:01:54 +01:00 committed by GitHub
commit 88c8e51ab8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1687,7 +1687,9 @@ impl PeerHandler {
B: AsRef<[u8]> + std::fmt::Debug, B: AsRef<[u8]> + std::fmt::Debug,
{ {
// TODO: this is just first attempt at pex - will need more sophistication on adding peers - BEP 40, check number of live, seen peers ... // TODO: this is just first attempt at pex - will need more sophistication on adding peers - BEP 40, check number of live, seen peers ...
msg.added_peers().for_each(|peer| { msg.dropped_peers()
.chain(msg.added_peers())
.for_each(|peer| {
self.state self.state
.add_peer_if_not_seen(peer.addr) .add_peer_if_not_seen(peer.addr)
.map_err(|error| { .map_err(|error| {