From 3cf6f5c8fbb6334f8d10f5ed26e88793618a8427 Mon Sep 17 00:00:00 2001 From: b5 Date: Wed, 10 Oct 2018 13:21:56 -0400 Subject: [PATCH] fix(p2p): fix concurrent writes to repo Profile store --- p2p/connected.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/p2p/connected.go b/p2p/connected.go index 3ec8c3a4f..a3a070998 100644 --- a/p2p/connected.go +++ b/p2p/connected.go @@ -94,11 +94,12 @@ func (n *QriNode) handleConnected(ws *WrappedStream, msg Message) (hangup bool) } // forward this message to all connected peers except the sender - pids := peerDifference(n.ConnectedQriPeerIDs(), []peer.ID{pinfo.ID}) - if err := n.SendMessage(msg, nil, pids...); err != nil { - log.Debug(err.Error()) - return - } + // TODO - this is causing concurrent iteration & write to the repo profile store. Fix + // pids := peerDifference(n.ConnectedQriPeerIDs(), []peer.ID{pinfo.ID}) + // if err := n.SendMessage(msg, nil, pids...); err != nil { + // log.Debug(err.Error()) + // return + // } // store that we've seen this message, cleaning up after a while n.msgState.Store(msg.ID, true)