From 9e9068eb828eff3469d2777872e71c0a3a61f1a6 Mon Sep 17 00:00:00 2001 From: ptrus Date: Thu, 24 Sep 2020 10:45:47 +0200 Subject: [PATCH] go/worker/p2p: Skip peer authentication for our own messages --- go/worker/common/p2p/dispatch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/go/worker/common/p2p/dispatch.go b/go/worker/common/p2p/dispatch.go index be2c19ab1c6..6046be6e596 100644 --- a/go/worker/common/p2p/dispatch.go +++ b/go/worker/common/p2p/dispatch.go @@ -165,6 +165,10 @@ func (h *topicHandler) dispatchMessage(peerID core.PeerID, m *queuedMsg, isIniti defer h.handlersLock.RUnlock() for _, handler := range h.handlers { + // Skip authentication if we are the peer. + if m.peerID == h.p2p.host.ID() { + break + } // Perhaps this should reject the message, but it is possible that // the local node is just behind. This does result in stale messages // getting retried though.