mirror of
https://github.com/PeernetOfficial/core.git
synced 2026-07-17 02:47:51 +01:00
contactArbitraryPeer only if not already in peer list.
Remove nodes from Kademlia structure when appropriate.
This commit is contained in:
@@ -195,6 +195,11 @@ func autoMulticastBroadcast() {
|
||||
}
|
||||
|
||||
func contactArbitraryPeer(publicKey *btcec.PublicKey, ip net.IP, port uint16) {
|
||||
// check first if peer is already in the list!
|
||||
if peer := PeerlistLookup(publicKey); peer != nil {
|
||||
return
|
||||
}
|
||||
|
||||
packets, err := msgEncodeAnnouncement(true, true, nil, nil, nil)
|
||||
if len(packets) == 0 || err != nil {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user