From cb81be94ec15d29d666deb1a56ee6653bf75e5e2 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Sun, 13 Jun 2021 12:31:52 -0500 Subject: [PATCH] skip multicast packets sent from our own key --- src/multicast/multicast.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/multicast/multicast.go b/src/multicast/multicast.go index 6f0e8f9..2b631ca 100644 --- a/src/multicast/multicast.go +++ b/src/multicast/multicast.go @@ -1,6 +1,7 @@ package multicast import ( + "bytes" "context" "crypto/ed25519" "encoding/hex" @@ -350,6 +351,9 @@ func (m *Multicast) listen() { } var key ed25519.PublicKey key = append(key, bs[:ed25519.PublicKeySize]...) + if bytes.Equal(key, m.core.GetSelf().Key) { + continue // don't bother trying to peer with self + } anAddr := string(bs[ed25519.PublicKeySize:nBytes]) addr, err := net.ResolveTCPAddr("tcp6", anAddr) if err != nil {