Skip to content

Commit

Permalink
go/worker/p2p: Skip peer authentication for our own messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrus committed Sep 24, 2020
1 parent a448c37 commit 9e9068e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions go/worker/common/p2p/dispatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9e9068e

Please sign in to comment.